Module: MassiveRecord::ORM::Timestamps

Extended by:
ActiveSupport::Concern
Defined in:
lib/massive_record/orm/timestamps.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#updated_atObject



30
31
32
# File 'lib/massive_record/orm/timestamps.rb', line 30

def updated_at
  self['updated_at']
end

#write_attribute(attr_name, value) ⇒ Object



34
35
36
37
38
39
40
41
42
# File 'lib/massive_record/orm/timestamps.rb', line 34

def write_attribute(attr_name, value)
  attr_name = attr_name.to_s

  if attr_name == 'updated_at' || (attr_name == 'created_at' && has_created_at?)
    raise MassiveRecord::ORM::CantBeManuallyAssigned.new("#{attr_name} can't be manually assigned.")
  end

  super
end