module Sequel::Plugins::AttributeCallbacks::RichDataCloner::InstanceMethods

Public Instance Methods

after_initialize() click to toggle source
Calls superclass method
# File lib/sequel/plugins/attribute_callbacks/rich_data_fixes.rb, line 18
def after_initialize
  super
  clone_rich_attributes
end
after_save() click to toggle source
Calls superclass method
# File lib/sequel/plugins/attribute_callbacks/rich_data_fixes.rb, line 23
def after_save
  super
  clone_rich_attributes
end

Private Instance Methods

clone_rich_attributes() click to toggle source

those are often going to be modified in place

# File lib/sequel/plugins/attribute_callbacks/rich_data_fixes.rb, line 31
def clone_rich_attributes
  values.each do |name, value|
    if value.kind_of?(Sequel::Postgres::PGArray) || value.kind_of?(Sequel::Postgres::HStore)
      initial_values[name] = value.clone
    end
  end
end