lib/rocket_job/plugins/document.rb in rocketjob-3.0.0.beta vs lib/rocket_job/plugins/document.rb in rocketjob-3.0.0.beta2

- old
+ new

@@ -70,10 +70,10 @@ # Allows other changes to be made on the server that will be loaded. def find_and_update(attrs) if doc = collection.find(_id: id).find_one_and_update({'$set' => attrs}, return_document: :after) # Clear out keys that are not returned during the reload from MongoDB (fields.keys + embedded_relations.keys - doc.keys).each { |key| send("#{key}=", nil) } - @attributes = attributes + @attributes = doc apply_defaults self else raise Mongoid::Error::DocumentNotFound, "Document match #{_id.inspect} does not exist in #{collection.name} collection" end