lib/mongoid/timestamps/updated.rb in mongoid-3.0.0.rc vs lib/mongoid/timestamps/updated.rb in mongoid-3.0.0
- old
+ new
@@ -6,10 +6,11 @@
module Updated
extend ActiveSupport::Concern
included do
field :updated_at, type: Time
- set_callback :save, :before, :set_updated_at, if: :able_to_set_updated_at?
+ set_callback :create, :before, :set_updated_at, if: :able_to_set_updated_at?
+ set_callback :update, :before, :set_updated_at, if: :able_to_set_updated_at?
end
# Update the updated_at field on the Document to the current time.
# This is only called on create and on save.
#