Sha256: 5a61015c6cbe7410a6193793430b8d0628538ec4c56186baa41e15e2920234b6

Contents?: true

Size: 474 Bytes

Versions: 37

Compression:

Stored size: 474 Bytes

Contents

# frozen_string_literal: true

require "store_model/ext/parent_assignment"

module StoreModel
  # ActiveRecord::Base patch with parent tracking support
  module Base
    include ParentAssignment

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

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

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
store_model-4.2.0 lib/store_model/ext/active_record/base.rb
store_model-4.1.0 lib/store_model/ext/active_record/base.rb
store_model-4.0.0 lib/store_model/ext/active_record/base.rb
store_model-3.0.2 lib/store_model/ext/active_record/base.rb
store_model-3.0.1 lib/store_model/ext/active_record/base.rb
store_model-3.0.0 lib/store_model/ext/active_record/base.rb
store_model-2.4.0 lib/store_model/ext/active_record/base.rb
store_model-2.3.0 lib/store_model/ext/active_record/base.rb
store_model-2.2.0 lib/store_model/ext/active_record/base.rb
store_model-2.1.2 lib/store_model/ext/active_record/base.rb
store_model-2.1.1 lib/store_model/ext/active_record/base.rb
store_model-2.1.0 lib/store_model/ext/active_record/base.rb
store_model-2.0.1 lib/store_model/ext/active_record/base.rb
store_model-2.0.0 lib/store_model/ext/active_record/base.rb
store_model-1.6.2 lib/store_model/ext/active_record/base.rb
store_model-1.6.1 lib/store_model/ext/active_record/base.rb
store_model-1.6.0 lib/store_model/ext/active_record/base.rb
store_model-1.5.1 lib/store_model/ext/active_record/base.rb
store_model-1.5.0 lib/store_model/ext/active_record/base.rb
store_model-1.4.0 lib/store_model/ext/active_record/base.rb