Class: RecordHistoryModel

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/record_history/record_history_model.rb

Instance Method Summary collapse

Instance Method Details

#new_valueObject



20
21
22
23
# File 'lib/record_history/record_history_model.rb', line 20

def new_value
  self.new_value = nil if self.new_value_dump.nil?
  decode_value(self.new_value_dump)
end

#new_value=(value) ⇒ Object



25
26
27
# File 'lib/record_history/record_history_model.rb', line 25

def new_value=(value)
  self.new_value_dump = encode_value(value)
end

#old_valueObject



11
12
13
14
# File 'lib/record_history/record_history_model.rb', line 11

def old_value
  self.old_value = nil if self.old_value_dump.nil?
  self.old_value_dump.nil? ? nil : decode_value(self.old_value_dump)
end

#old_value=(value) ⇒ Object



16
17
18
# File 'lib/record_history/record_history_model.rb', line 16

def old_value=(value)
  self.old_value_dump = encode_value(value)
end