Module: SimplyCouch::Model::Persistence::MagicTimestamps

Defined in:
lib/simply_couch/model/persistence.rb

Overview

── Magic Timestamps ─────────────────────────────────────────────────

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



288
289
290
291
292
293
294
295
# File 'lib/simply_couch/model/persistence.rb', line 288

def self.included(base)
  base.instance_eval do
    property :created_at, type: Time
    property :updated_at, type: Time
    before_create :set_created_at
    before_save :set_updated_at
  end
end