scope :valid, -> { where(:invalidated_at => nil) }
- validates_presence_of :user, :secret
+ validates :user, :secret, :presence => true
before_create :set_authorized_at
-
-protected
-
+
+ protected
+
def set_authorized_at
self.authorized_at = Time.now
end