Log all activerecord and activemodel user issues #2808

This commit is contained in:
Priit Tark 2015-07-23 16:51:32 +03:00
parent 09deb2b187
commit dd7771c59d
5 changed files with 26 additions and 2 deletions

View file

@ -0,0 +1,7 @@
# Log all user issues raised by active record
class ActiveRecord::Base
after_validation do |m|
Rails.logger.info "USER MSG: #{Time.now.to_s(:db)} ACTIVERECORD: #{m.class} ##{m.id} #{m.errors.full_messages} #{m.errors['epp_errors']}" if m.errors.present?
true
end
end