lib/devise/token_authenticatable/model.rb in devise-token_authenticatable-0.1.0 vs lib/devise/token_authenticatable/model.rb in devise-token_authenticatable-0.2.0.beta1
- old
+ new
@@ -47,11 +47,11 @@
end
# Generate new authentication token and save the record.
def reset_authentication_token!
reset_authentication_token
- save(:validate => false)
+ save(validate: false)
end
# Generate authentication token unless already exists.
def ensure_authentication_token
reset_authentication_token if authentication_token.blank?
@@ -70,17 +70,17 @@
self.class.expire_auth_token_on_timeout
end
module ClassMethods
def find_for_token_authentication(conditions)
- find_for_authentication(:authentication_token => conditions[Devise::TokenAuthenticatable.token_authentication_key])
+ find_for_authentication(authentication_token: conditions[Devise::TokenAuthenticatable.token_authentication_key])
end
# Generate a token checking if one does not already exist in the database.
def authentication_token
loop do
token = Devise.friendly_token
- break token unless to_adapter.find_first({ :authentication_token => token })
+ break token unless to_adapter.find_first({ authentication_token: token })
end
end
Devise::Models.config(self, :token_authentication_key, :expire_auth_token_on_timeout)
end