Module: PaperTrail::Reifier Private

Defined in:
lib/paper_trail/reifier.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.

Given a version record and some options, builds a new model object.

Class Method Summary collapse

Class 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.



12
13
14
15
16
17
18
19
# File 'lib/paper_trail/reifier.rb', line 12

def reify(version, options)
  options = apply_defaults_to(options, version)
  attrs = version.object_deserialized
  model = init_model(attrs, options, version)
  reify_attributes(model, version, attrs)
  model.send "#{model.class.version_association_name}=", version
  model
end