X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/52e5fa6ad78f375cec5a207a123a4aa3939c8ddf..4729163aa8e9bf6a7c9f12a8fcd77e6b632e9d80:/app/models/oauth_token.rb?ds=sidebyside diff --git a/app/models/oauth_token.rb b/app/models/oauth_token.rb index b38fe0ec0..0fe0bea30 100644 --- a/app/models/oauth_token.rb +++ b/app/models/oauth_token.rb @@ -2,7 +2,7 @@ class OauthToken < ActiveRecord::Base belongs_to :client_application belongs_to :user - scope :authorized, where("authorized_at IS NOT NULL and invalidated_at IS NULL") + scope :authorized, -> { where("authorized_at IS NOT NULL and invalidated_at IS NULL") } validates_uniqueness_of :token validates_presence_of :client_application, :token @@ -14,7 +14,7 @@ class OauthToken < ActiveRecord::Base end def invalidate! - update_attribute(:invalidated_at, Time.now) + update_attributes(:invalidated_at => Time.now) end def authorized?