Class: Revision::Auditor

Inherits:
Revision show all
Defined in:
lib/controlled_versioning/revision/auditor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(versionable) ⇒ Auditor

Returns a new instance of Auditor.



4
5
6
# File 'lib/controlled_versioning/revision/auditor.rb', line 4

def initialize(versionable)
  @versionable = versionable
end

Instance Attribute Details

#versionableObject (readonly)

Returns the value of attribute versionable.



3
4
5
# File 'lib/controlled_versioning/revision/auditor.rb', line 3

def versionable
  @versionable
end

Instance Method Details

#changes_original?Boolean

Returns:

  • (Boolean)


8
9
10
11
12
13
# File 'lib/controlled_versioning/revision/auditor.rb', line 8

def changes_original?
  return true if versionable.marked_for_destruction?
  return true if changes_at_least_one_attribute?
  return true if changes_at_least_one_nested_association?
  return false
end