Method: Sequel::Plugins::Dirty::InstanceMethods#column_previously_was

Defined in:
lib/sequel/plugins/dirty.rb

#column_previously_was(column) ⇒ Object

The previous value of the column, which is the initial value of the column before the object was previously saved.

initial_value(:name) # => 'Initial'
update(name: 'Current')
column_previously_was(:name) # => 'Initial'


148
149
150
# File 'lib/sequel/plugins/dirty.rb', line 148

def column_previously_was(column)
  (pc = @previous_changes) && (val = pc[column]) && val[0]
end