Sha256: 17a4c16840286f7d384cc81a8e2843c3c26b06515415d62ae56d21fe44565dc5

Contents?: true

Size: 475 Bytes

Versions: 13

Compression:

Stored size: 475 Bytes

Contents

# frozen_string_literal: true

require "store_model/ext/parent_assignment"

module StoreModel
  # ActiveModel::Attributes patch with parent tracking support
  module Attributes
    include ParentAssignment

    private

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

    def write_attribute(*)
      super.tap do |value|
        assign_parent_to_store_model_relation(value)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
store_model-0.13.0 lib/store_model/ext/active_model/attributes.rb
store_model-0.12.0 lib/store_model/ext/active_model/attributes.rb
store_model-0.11.1 lib/store_model/ext/active_model/attributes.rb
store_model-0.11.0 lib/store_model/ext/active_model/attributes.rb
store_model-0.10.0 lib/store_model/ext/active_model/attributes.rb
store_model-0.9.0 lib/store_model/ext/active_model/attributes.rb
store_model-0.8.2 lib/store_model/ext/active_model/attributes.rb
store_model-0.8.1 lib/store_model/ext/active_model/attributes.rb
store_model-0.8.0 lib/store_model/ext/active_model/attributes.rb
store_model-0.7.0 lib/store_model/ext/active_model/attributes.rb
store_model-0.6.2 lib/store_model/ext/active_model/attributes.rb
store_model-0.6.1 lib/store_model/ext/active_model/attributes.rb
store_model-0.6.0 lib/store_model/ext/active_model/attributes.rb