From a770d020f9cbd6fcf2934707d08d7fe35e592b9c Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 27 Jul 2012 12:24:44 +0100 Subject: [PATCH] Replace deprecated update_attribute method --- app/models/oauth_token.rb | 4 +++- app/models/user.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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 -- 2.39.5