lib/mongoid/versioning.rb in mongoid-2.3.3 vs lib/mongoid/versioning.rb in mongoid-2.3.4
- old
+ new
@@ -115,12 +115,14 @@
#
# @return [ Document, nil ] The previously saved document.
#
# @since 2.0.0
def previous_revision
- self.class.
- where(:_id => id).
- any_of({ :version => version }, { :version => nil }).first
+ _loading_revision do
+ self.class.
+ where(:_id => id).
+ any_of({ :version => version }, { :version => nil }).first
+ end
end
# Is the document able to be revised? This is true if the document has
# changed and we have not explicitly told it not to version.
#