Module: Warnr::ClassMethods

Defined in:
lib/warnr.rb

Instance Method Summary collapse

Instance Method Details

#on_save_with_warnings(method) ⇒ Object

Pass a method name; sets up a callback which runs after create_or_update.



31
32
33
# File 'lib/warnr.rb', line 31

def on_save_with_warnings(method)
  set_callback(:on_save_with_warnings, :after, method)
end

#treat_validation_errors_as_warnings_on(*fields) ⇒ Object

Specify a list of fields to work on. Validation errors on these fields will be ignored.



26
27
28
# File 'lib/warnr.rb', line 26

def treat_validation_errors_as_warnings_on(*fields)
  self.warnr_warning_fields = self.warnr_warning_fields | fields
end