module Risky::Timestamps

Public Instance Methods

before_create() click to toggle source
Calls superclass method
# File lib/risky/timestamps.rb, line 13
def before_create
  super

  begin
    self.created_at ||= Time.now
  rescue
  end
end
before_save() click to toggle source

If created_at and/or updated_at are present, updates them before creation and save, respectively.

Calls superclass method
# File lib/risky/timestamps.rb, line 5
def before_save
  super
  begin
    self.updated_at = Time.now
  rescue
  end
end