Sha256: 5aa6b2254a2e01f148f70cf74081fa0d0e451cb0f75c75f468edf1ac48e2908b
Contents?: true
Size: 527 Bytes
Versions: 37
Compression:
Stored size: 527 Bytes
Contents
# frozen_string_literal: true module StoreModel # Helper methods for ActiveModel and ActiveRecord parent tracking support module ParentAssignment private def assign_parent_to_store_model_relation(attribute) assign_parent_to_singular_store_model(attribute) return unless attribute.is_a?(Array) attribute.each(&method(:assign_parent_to_singular_store_model)) end def assign_parent_to_singular_store_model(item) item.parent = self if item.is_a?(StoreModel::Model) end end end
Version data entries
37 entries across 37 versions & 1 rubygems