lib/devise/models/rememberable.rb in devise-3.2.3 vs lib/devise/models/rememberable.rb in devise-3.2.4
- old
+ new
@@ -48,20 +48,20 @@
# Generate a new remember token and save the record without validations
# unless remember_across_browsers is true and the user already has a valid token.
def remember_me!(extend_period=false)
self.remember_token = self.class.remember_token if generate_remember_token?
self.remember_created_at = Time.now.utc if generate_remember_timestamp?(extend_period)
- save(:validate => false) if self.changed?
+ save(validate: false) if self.changed?
end
# If the record is persisted, remove the remember token (but only if
# it exists), and save the record without validations.
def forget_me!
return unless persisted?
self.remember_token = nil if respond_to?(:remember_token=)
self.remember_created_at = nil
- save(:validate => false)
+ save(validate: false)
end
# Remember token should be expired if expiration time not overpass now.
def remember_expired?
remember_created_at.nil? || (remember_expires_at <= Time.now.utc)
@@ -116,10 +116,10 @@
# Generate a token checking if one does not already exist in the database.
def remember_token #:nodoc:
loop do
token = Devise.friendly_token
- break token unless to_adapter.find_first({ :remember_token => token })
+ break token unless to_adapter.find_first({ remember_token: token })
end
end
Devise::Models.config(self, :remember_for, :extend_remember_period, :rememberable_options)
end