Module: ARCompatibilityModule

Defined in:
lib/cms/behaviors.rb

Instance Method Summary collapse

Instance Method Details

#compatible_clear_changes_informationObject

TODO: modification of changed_attributes is forbidden in later rails -> find alternative



38
39
40
41
42
43
44
45
46
47
# File 'lib/cms/behaviors.rb', line 38

def compatible_clear_changes_information
  # for rails 4.2 compat
  if respond_to?(:clear_changes_information) # rails 4.2
    clear_changes_information
  elsif respond_to?(:reset_changes) # rails 4.1
    reset_changes
  else
    changed_attributes.clear # rails < 4.1
  end
end