diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-12-16 15:44:50 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-12-16 15:44:50 +0300 |
commit | 40104746d6418b54cd80726d77c05e85cf2ddbb3 (patch) | |
tree | aaa9bd256a8fefc7fb9dfcbe123dc869550dfb71 /app/models/concerns | |
parent | 5ffed49fef07a06f46f7e4e3511d7f6b9f378892 (diff) | |
parent | 907209821590efc34b11b60a042c6554bd11897f (diff) |
Merge remote-tracking branch 'origin/feature/update-rubocop'
Diffstat (limited to 'app/models/concerns')
-rw-r--r-- | app/models/concerns/token_authenticatable.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/concerns/token_authenticatable.rb b/app/models/concerns/token_authenticatable.rb index 56d38fe8250..488ff8c31b7 100644 --- a/app/models/concerns/token_authenticatable.rb +++ b/app/models/concerns/token_authenticatable.rb @@ -13,7 +13,7 @@ module TokenAuthenticatable @token_fields << token_field define_singleton_method("find_by_#{token_field}") do |token| - where(token_field => token).first if token + find_by(token_field => token) if token end define_method("ensure_#{token_field}") do @@ -37,7 +37,7 @@ module TokenAuthenticatable def generate_token_for(token_field) loop do token = Devise.friendly_token - break token unless self.class.unscoped.where(token_field => token).first + break token unless self.class.unscoped.find_by(token_field => token) end end end |