Module: PaperTrailAssociationTracking::Reifiers::HasOne Private

Defined in:
lib/paper_trail_association_tracking/reifiers/has_one.rb

Overview

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.

Reify a single ‘has_one` association of `model`.

Defined Under Namespace

Classes: FoundMoreThanOne

Class Method Summary collapse

Class Method Details

.reify(assoc, model, options, transaction_id) ⇒ 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.



42
43
44
45
46
47
48
49
50
# File 'lib/paper_trail_association_tracking/reifiers/has_one.rb', line 42

def reify(assoc, model, options, transaction_id)
  version = load_version(assoc, model, transaction_id, options[:version_at])
  return unless version
  if version.event == "create"
    create_event(assoc, model, options)
  else
    noncreate_event(assoc, model, options, version)
  end
end