Module: NotifyIfInvalid::InstanceMethods

Defined in:
lib/notify_if_invalid.rb

Instance Method Summary collapse

Instance Method Details

#check_if_invalidObject



22
23
24
25
26
27
# File 'lib/notify_if_invalid.rb', line 22

def check_if_invalid
  return if self.errors.empty?
  message = "#{self.class.to_s} #{self.errors.full_messages.to_sentence}: #{self.inspect}"
  error = ValidationError.new message
  Airbrake.notify_or_ignore error
end