Module: Cti::ActiveRecord::ActsAsHeir::InstanceMethods

Defined in:
lib/cti/active_record/acts_as_heir.rb

Instance Method Summary collapse

Instance Method Details

#heritageObject



86
87
88
# File 'lib/cti/active_record/acts_as_heir.rb', line 86

def heritage
  predecessor
end

#lineageObject



90
91
92
# File 'lib/cti/active_record/acts_as_heir.rb', line 90

def lineage
  self
end

#predecessor_with_build(attributes = {}) ⇒ Object



94
95
96
# File 'lib/cti/active_record/acts_as_heir.rb', line 94

def predecessor_with_build(attributes = {})
  predecessor_without_build || build_predecessor(attributes)
end

#touch_predecessorObject



98
99
100
101
102
# File 'lib/cti/active_record/acts_as_heir.rb', line 98

def touch_predecessor
  if self.changed?
    predecessor.touch
  end
end