Do not rely on attribute? methods since they are not available in Datamapper.
This commit is contained in:
parent
2f759f8d29
commit
3efc0ec08a
|
@ -1,3 +1,6 @@
|
|||
* enhancements
|
||||
* [#45] Do not rely attribute? methods, since they are not added on Datamapper
|
||||
|
||||
== 0.5.6
|
||||
|
||||
* enhancements
|
||||
|
|
2
TODO
2
TODO
|
@ -1,3 +1,5 @@
|
|||
* Create update_with_password
|
||||
* Make test run with different ORMs
|
||||
* Devise::Timeoutable
|
||||
* Use request_ip in session cookies
|
||||
* Devise::BruteForceProtection
|
||||
|
|
|
@ -51,7 +51,7 @@ module Devise
|
|||
|
||||
# Verifies whether a user is confirmed or not
|
||||
def confirmed?
|
||||
!new_record? && confirmed_at?
|
||||
!new_record? && !confirmed_at.nil?
|
||||
end
|
||||
|
||||
# Send confirmation instructions by email
|
||||
|
@ -100,8 +100,8 @@ module Devise
|
|||
# confirmation_period_valid? # will always return false
|
||||
#
|
||||
def confirmation_period_valid?
|
||||
confirmation_sent_at? &&
|
||||
(Time.now.utc - confirmation_sent_at.utc) < confirm_within
|
||||
confirmation_sent_at &&
|
||||
((Time.now.utc - confirmation_sent_at.utc) < confirm_within)
|
||||
end
|
||||
|
||||
# Checks whether the record is confirmed or not, yielding to the block
|
||||
|
|
|
@ -51,7 +51,7 @@ module Devise
|
|||
# Removes the remember token only if it exists, and save the record
|
||||
# without validations.
|
||||
def forget_me!
|
||||
if remember_token?
|
||||
if remember_token
|
||||
self.remember_token = nil
|
||||
self.remember_created_at = nil
|
||||
save(false)
|
||||
|
@ -60,7 +60,7 @@ module Devise
|
|||
|
||||
# Checks whether the incoming token matches or not with the record token.
|
||||
def valid_remember_token?(token)
|
||||
remember_token? && !remember_expired? && remember_token == token
|
||||
remember_token && !remember_expired? && remember_token == token
|
||||
end
|
||||
|
||||
# Remember token should be expired if expiration time not overpass now.
|
||||
|
|
Loading…
Reference in New Issue