Module: StoreModel::Base

Includes:
ParentAssignment
Defined in:
lib/store_model/ext/active_record/base.rb

Overview

ActiveRecord::Base patch with parent tracking support

Instance Method Summary collapse

Instance Method Details

#_read_attributeObject



10
11
12
13
14
# File 'lib/store_model/ext/active_record/base.rb', line 10

def _read_attribute(*)
  super.tap do |attribute|
    assign_parent_to_store_model_relation(attribute)
  end
end

#_write_attributeObject



16
17
18
19
20
# File 'lib/store_model/ext/active_record/base.rb', line 16

def _write_attribute(*)
  super.tap do |attribute|
    assign_parent_to_store_model_relation(attribute)
  end
end