diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc index a1296c36..7d3f13ea 100644 --- a/CHANGELOG.rdoc +++ b/CHANGELOG.rdoc @@ -1,3 +1,6 @@ +* enhancements + * [#45] Do not rely attribute? methods, since they are not added on Datamapper + == 0.5.6 * enhancements diff --git a/TODO b/TODO index 37c1ace7..7c9a8f0f 100644 --- a/TODO +++ b/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 diff --git a/lib/devise/models/confirmable.rb b/lib/devise/models/confirmable.rb index 3f78d857..92d4309d 100644 --- a/lib/devise/models/confirmable.rb +++ b/lib/devise/models/confirmable.rb @@ -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 diff --git a/lib/devise/models/rememberable.rb b/lib/devise/models/rememberable.rb index 81565f8d..ce452b33 100644 --- a/lib/devise/models/rememberable.rb +++ b/lib/devise/models/rememberable.rb @@ -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.