Module: Ohm::Timestamping
- Defined in:
- lib/ohm/contrib/timestamping.rb
Overview
Provides created_at / updated_at timestamps.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
19 20 21 22 |
# File 'lib/ohm/contrib/timestamping.rb', line 19 def self.included(base) base.attribute :created_at base.attribute :updated_at end |
Instance Method Details
#create ⇒ Object
24 25 26 27 28 |
# File 'lib/ohm/contrib/timestamping.rb', line 24 def create self.created_at ||= Time.now.utc super end |