Skip to content

Commit

Permalink
Merge pull request mongodb#916 from bernerdschaefer/master
Browse files Browse the repository at this point in the history
Minor tweaks to Mongoid::Paranoia
  • Loading branch information
durran committed May 12, 2011
2 parents c7c3e49 + c0d8138 commit 776baf6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/mongoid/paranoia.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def delete!
# true
def remove(options = {})
now = Time.now
collection.update({ :_id => self.id }, { '$set' => { :deleted_at => Time.now } })
collection.update({ :_id => id }, { '$set' => { :deleted_at => now } })
@attributes["deleted_at"] = now
true
end
Expand All @@ -72,7 +72,7 @@ def destroyed?
#
# <tt>document.restore</tt>
def restore
collection.update({ :_id => self.id }, { '$unset' => { :deleted_at => true } })
collection.update({ :_id => id }, { '$unset' => { :deleted_at => true } })
@attributes.delete("deleted_at")
end

Expand Down

0 comments on commit 776baf6

Please sign in to comment.