diff --git a/Gemfile b/Gemfile index d6801f04..e901e5de 100644 --- a/Gemfile +++ b/Gemfile @@ -22,8 +22,8 @@ platforms :ruby do end group :mongoid do - gem "mongo", "1.1.2" - gem "mongoid", "2.0.0.beta.20" - gem "bson_ext", "1.2.1" + gem "mongo", "~> 1.3.0" + gem "mongoid", "2.0.1" + gem "bson_ext", "~> 1.3.0" end end diff --git a/Gemfile.lock b/Gemfile.lock index df46101b..8eca0d11 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -43,8 +43,9 @@ GEM addressable (2.2.4) arel (2.0.8) bcrypt-ruby (2.1.4) - bson (1.2.1) - bson_ext (1.2.1) + bcrypt-ruby (2.1.4-java) + bson (1.3.0) + bson_ext (1.3.0) builder (2.1.2) columnize (0.3.2) erubis (2.6.6) @@ -63,11 +64,11 @@ GEM treetop (~> 1.4.8) mime-types (1.16) mocha (0.9.12) - mongo (1.1.2) - bson (>= 1.1.1) - mongoid (2.0.0.beta.20) + mongo (1.3.0) + bson (>= 1.3.0) + mongoid (2.0.1) activemodel (~> 3.0) - mongo (~> 1.1) + mongo (~> 1.3) tzinfo (~> 0.3.22) will_paginate (~> 3.0.pre) multi_json (0.0.5) @@ -145,11 +146,11 @@ PLATFORMS DEPENDENCIES activerecord-jdbcsqlite3-adapter - bson_ext (= 1.2.1) + bson_ext (~> 1.3.0) devise! mocha - mongo (= 1.1.2) - mongoid (= 2.0.0.beta.20) + mongo (~> 1.3.0) + mongoid (= 2.0.1) oa-oauth (~> 0.2.0) oa-openid (~> 0.2.0) rails (~> 3.0.4) diff --git a/lib/devise/models/rememberable.rb b/lib/devise/models/rememberable.rb index 2184a0ae..ad626788 100644 --- a/lib/devise/models/rememberable.rb +++ b/lib/devise/models/rememberable.rb @@ -54,12 +54,10 @@ module Devise save(:validate => false) end - # If the record has not been destroyed, removes the remember token only if - # it exists, and save the record without validations. - # Using #destroyed? if present because of Mongoid bug in #persisted? prior - # to Mongoid v2.0.1; going forward, this should just use #persisted? + # If the record is persisted, remove the remember token (but only if + # it exists), and save the record without validations. def forget_me! - if (respond_to?(:destroyed?) ? !destroyed? : persisted?) + if persisted? self.remember_token = nil if respond_to?(:remember_token=) self.remember_created_at = nil save(:validate => false)