Module: PaperTrailAssociationTracking::Reifier::ClassMethods Private
- Included in:
- PaperTrail::Reifier
- Defined in:
- lib/paper_trail_association_tracking/reifier.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
-
#reify(version, options) ⇒ Object
private
See ‘VersionConcern#reify` for documentation.
-
#reify_has_manys(transaction_id, model, options = {}) ⇒ Object
private
Restore the ‘model`’s has_many associations as they were at version_at timestamp We lookup the first child versions after version_at timestamp or in same transaction.
Instance Method Details
#reify(version, options) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
See ‘VersionConcern#reify` for documentation.
16 17 18 19 20 21 |
# File 'lib/paper_trail_association_tracking/reifier.rb', line 16 def reify(version, ) = apply_defaults_to(, version) model = super reify_associations(model, , version) model end |
#reify_has_manys(transaction_id, model, options = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Restore the ‘model`’s has_many associations as they were at version_at timestamp We lookup the first child versions after version_at timestamp or in same transaction.
27 28 29 30 31 32 33 |
# File 'lib/paper_trail_association_tracking/reifier.rb', line 27 def reify_has_manys(transaction_id, model, = {}) assoc_has_many_through, assoc_has_many_directly = model.class.reflect_on_all_associations(:has_many). partition { |assoc| assoc.[:through] } reify_has_many_associations(transaction_id, assoc_has_many_directly, model, ) reify_has_many_through_associations(transaction_id, assoc_has_many_through, model, ) end |