From 9293d0996a1bd333e6b8dbef9b85648cbdba7c00 Mon Sep 17 00:00:00 2001 From: Georg Kahest Date: Mon, 23 Oct 2017 12:13:36 +0300 Subject: [PATCH] use custom validator until validation errors are present in UI --- config/initializers/eis_custom_active_record.rb | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 config/initializers/eis_custom_active_record.rb diff --git a/config/initializers/eis_custom_active_record.rb b/config/initializers/eis_custom_active_record.rb new file mode 100644 index 000000000..60dcebeb9 --- /dev/null +++ b/config/initializers/eis_custom_active_record.rb @@ -0,0 +1,8 @@ +# Log all user issues raised by active record +# rubocop: disable Metrics/LineLength +class ActiveRecord::Base + after_validation do |m| + Rails.logger.info "USER MSG: ACTIVERECORD: #{m.class} ##{m.id} #{m.errors.full_messages} #{m.errors['epp_errors']}" if m.errors.present? + true + end +end