Module: Abbish::Sequel::Plugins::Model::SuperRecord::Timestamp::InstanceMethods

Defined in:
lib/model/super_record/timestamp.rb

Instance Method Summary collapse

Instance Method Details

#before_createObject



34
35
36
37
# File 'lib/model/super_record/timestamp.rb', line 34

def before_create
  send("#{self.class.record_timestamp_options[:feature_column_created_time]}=", _get_time) if self.class.record_timestamp_options[:enabled]
  super
end

#before_updateObject



39
40
41
42
# File 'lib/model/super_record/timestamp.rb', line 39

def before_update
  send("#{self.class.record_timestamp_options[:feature_column_updated_time]}=", _get_time) if self.class.record_timestamp_options[:enabled] if self.modified?
  super
end