Restore eis custom files #2793

This commit is contained in:
Priit Tark 2015-07-28 10:33:13 +03:00
parent 7f44227370
commit 4178b7d97d
4 changed files with 66 additions and 0 deletions

View file

@ -0,0 +1,18 @@
# Log all active model user errors
module ActiveModel
class Errors
def add(attribute, message = :invalid, options = {})
message = normalize_message(attribute, message, options)
if exception = options[:strict]
exception = ActiveModel::StrictValidationFailed if exception == true
raise exception, full_message(attribute, message)
end
# CUSTOM logging
Rails.logger.info "USER MSG: ACTIVEMODEL: #{@base.try(:class)} [#{attribute}] #{message}" if message.present?
# END of CUSTOM logging
self[attribute] << message
end
end
end