X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ca30b879f6eba3f513bcfa53545dba43d09b2023..47e6637f180c9ffa3950ee9307f9667ffcfc2ee3:/app/models/access_token.rb?ds=sidebyside diff --git a/app/models/access_token.rb b/app/models/access_token.rb index 3aa6f9daf..f690c9754 100644 --- a/app/models/access_token.rb +++ b/app/models/access_token.rb @@ -4,12 +4,12 @@ class AccessToken < OauthToken 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