From: Tom Hughes Date: Fri, 27 Jul 2012 11:24:44 +0000 (+0100) Subject: Replace deprecated update_attribute method X-Git-Tag: live~5463 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/a770d020f9cbd6fcf2934707d08d7fe35e592b9c Replace deprecated update_attribute method --- diff --git a/app/models/oauth_token.rb b/app/models/oauth_token.rb index b38fe0ec0..c9595e870 100644 --- a/app/models/oauth_token.rb +++ b/app/models/oauth_token.rb @@ -14,7 +14,9 @@ class OauthToken < ActiveRecord::Base end def invalidate! - update_attribute(:invalidated_at, Time.now) + update_attributes({ + :invalidated_at => Time.now + }, :without_protection => true) end def authorized? diff --git a/app/models/user.rb b/app/models/user.rb index 8a594b01d..1b9dd54e7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -76,7 +76,7 @@ class User < ActiveRecord::Base user = nil end - token.update_attribute(:expiry, 1.week.from_now) if token and user + token.update_column(:expiry, 1.week.from_now) if token and user return user end