Module: PolyBelongsTo::Dup
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/poly_belongs_to/dup.rb
Overview
PolyBelongsTo::Dup contains duplication methods which is included on all ActiveModel & ActiveRecord instances
Instance Method Summary collapse
-
#pbt_deep_dup_build(item_to_duplicate, &block) ⇒ Object
Build child object by dup’ing its attributes.
-
#pbt_dup_build(item_to_duplicate, &block) ⇒ Object
Build child object by dup’ing its attributes.
Instance Method Details
#pbt_deep_dup_build(item_to_duplicate, &block) ⇒ Object
Build child object by dup’ing its attributes. Recursive for ancestry tree.
51 52 53 |
# File 'lib/poly_belongs_to/dup.rb', line 51 def pbt_deep_dup_build(item_to_duplicate, &block) self.class.pbt_deep_dup_build(self, item_to_duplicate, &block) end |
#pbt_dup_build(item_to_duplicate, &block) ⇒ Object
Build child object by dup’ing its attributes
45 46 47 |
# File 'lib/poly_belongs_to/dup.rb', line 45 def pbt_dup_build(item_to_duplicate, &block) self.class.pbt_dup_build(self, item_to_duplicate, &block) end |