1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Use updated Mongoid gem and remove #destroyed?

This commit is contained in:
Chase DuBois 2011-04-23 21:58:26 +08:00 committed by José Valim
parent 89e4ab8a45
commit 4a3ad7f348
3 changed files with 16 additions and 17 deletions

View file

@ -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

View file

@ -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)

View file

@ -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)