X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/52e5fa6ad78f375cec5a207a123a4aa3939c8ddf..a6b84a0294a2929006ff056f56103be549c5b5a2:/app/models/access_token.rb?ds=inline diff --git a/app/models/access_token.rb b/app/models/access_token.rb index a1888343a..2bf226784 100644 --- a/app/models/access_token.rb +++ b/app/models/access_token.rb @@ -2,14 +2,14 @@ class AccessToken < OauthToken belongs_to :user belongs_to :client_application - scope :valid, where(:invalidated_at => nil) + scope :valid, -> { where(:invalidated_at => nil) } validates_presence_of :user, :secret before_create :set_authorized_at - -protected - + + protected + def set_authorized_at self.authorized_at = Time.now end