Class: ConstancyValidation::OriginalAttributesCapture

Inherits:
Object
  • Object
show all
Defined in:
lib/validates_constancy/constancy_validation.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.extend(klass) ⇒ Object



75
76
77
78
79
80
81
82
83
84
85
# File 'lib/validates_constancy/constancy_validation.rb', line 75

def extend(klass)
  return false if klass.method_defined?(:capture_original_attributes)
  
  create_method_capture_original_attributes klass
  
  create_method_after_find_unless_exists klass
  klass.after_find :capture_original_attributes
  klass.after_save :capture_original_attributes
  
  true
end