Module: Mongoid::Timestamps::Updated

Extended by:
ActiveSupport::Concern
Included in:
Mongoid::Timestamps
Defined in:
lib/mongoid/timestamps/updated.rb

Overview

This module handles the behaviour for setting up document updated at timestamp.

Instance Method Summary collapse

Instance Method Details

#set_updated_atObject

Update the updated_at field on the Document to the current time. This is only called on create and on save.

Examples:

Set the updated at time.

person.set_updated_at


28
29
30
# File 'lib/mongoid/timestamps/updated.rb', line 28

def set_updated_at
  self.updated_at = Time.now.utc
end