Module: ActiveRecord::RecordMessages

Included in:
RecordNotDestroyed, RecordNotSaved, SoleRecordExceeded, StaleObjectError
Defined in:
lib/coaster/rails_ext/active_record/errors.rb

Instance Method Summary collapse

Instance Method Details

#user_messageObject

user friendly message, for overid



4
5
6
7
8
9
10
11
# File 'lib/coaster/rails_ext/active_record/errors.rb', line 4

def user_message
  return _translate if description.present? || tkey.present?
  return record.errors.full_messages.join(', ') if record.present?
  return "#{_translate} (#{user_digests})" unless defined?(@coaster)
  message
rescue => e
  "#{message} (user_message_error - #{e.class.name} #{e.message})"
end