Skip to content

Instantly share code, notes, and snippets.

@markevich
Created October 30, 2013 08:10
Show Gist options
  • Select an option

  • Save markevich/7228804 to your computer and use it in GitHub Desktop.

Select an option

Save markevich/7228804 to your computer and use it in GitHub Desktop.
Show activerecord validation errors in log
# model
after_validation :log_errors, :if => Proc.new {|m| m.errors}
def log_errors
Rails.logger.debug self.errors.full_messages.join("\n")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment