Module: Pageflow::RevisionComponent

Extended by:
ActiveSupport::Concern
Included in:
FileUsage, Storyline
Defined in:
lib/pageflow/revision_component.rb

Overview

RevisionComponent represents a model that is attached to the revision mechanism of Pageflow.

In order to be used as a revision component, a model is required to have an integer field ‘perma_id` and a `revision_id` foreign key.

Defined Under Namespace

Modules: ClassMethods Classes: PermaIdGenerationAdvisoryLockTimeout

Constant Summary collapse

ADVISORY_LOCK_TIMEOUT_SECONDS =
5

Instance Method Summary collapse

Instance Method Details

#copy_to(revision) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/pageflow/revision_component.rb', line 22

def copy_to(revision)
  record = dup
  record.revision = revision
  record.save!

  copy_nested_revision_component_to(record)
end