Methods

Class/Module Index [+]

Quicksearch

Mongoid::Timestamps::Created

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

Public Instance Methods

set_created_at() click to toggle source

Update the created_at field on the Document to the current time. This is only called on create.

@example Set the created at time.

person.set_created_at
# File lib/mongoid/timestamps/created.rb, line 18
def set_created_at
  self.created_at = Time.now.utc if !created_at
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.