lib/paper_trail/reifier.rb
# Restore the `model`'s has_many associations through another association.
# This must be called after the direct has_manys have been reified
# (reify_has_many_directly).
Restore the `model`'s has_many associations through another association.
This must be called after the direct has_manys have been reified
(reify_has_many_directly).
Restore the ` model ` ' s has_many associations through another association . This must be called after the direct has_manys have been reified ( reify_has_many_directly ) .
def reify_has_many_through(transaction_id, associations, model, options = {})
        each_enabled_association(associations) do |assoc|
          through_collection = model.send(assoc.options[:through])
          collection = hmt_collection(through_collection, assoc, options, transaction_id)
          model.send(assoc.name).proxy_association.target = collection
        end
      end
def reify_has_many_through ( transaction_id , associations , model , options = { } ) each_enabled_association ( associations ) do | assoc | through_collection = model . send ( assoc . options [ :through ] ) collection = hmt_collection ( through_collection , assoc , options , transaction_id ) model . send ( assoc . name ) . proxy_association . target = collection end end
Restore the `model`'s has_many associations through another association.
Restore the ` model ` ' s has_many associations through another association .
# Load the collection of through-models. For example, if `model` is a # Chapter, having many Paragraphs through Sections, then # `through_collection` will contain Sections. # Now, given the collection of "through" models (e.g. sections), load # the collection of "target" models (e.g. paragraphs) # Finally, assign the `collection` of "target" models, e.g. to # `model.paragraphs`.
transaction_id
<not_specific>
associations
<not_specific>
model
<not_specific>
options
<not_specific>