Module: Rmodel::RepositoryExt::Timestampable
- Included in:
- Rmodel::Repository
- Defined in:
- lib/rmodel/repository_ext/timestampable.rb
Instance Method Summary collapse
Instance Method Details
#insert_one(object) ⇒ Object
4 5 6 7 |
# File 'lib/rmodel/repository_ext/timestampable.rb', line 4 def insert_one(object) object.created_at = now if able_to_set_created_at?(object) super end |
#update(object) ⇒ Object
9 10 11 12 |
# File 'lib/rmodel/repository_ext/timestampable.rb', line 9 def update(object) object.updated_at = now if able_to_set_updated_at?(object) super end |