Class: ActiveModel::BetterErrors::HumanMessageFormatter
- Defined in:
- lib/active_model/better_errors/human_message_formatter.rb
Overview
HumanMessageFormatter
Instance Attribute Summary
Attributes inherited from Formatter
Instance Method Summary collapse
Methods inherited from Formatter
Constructor Details
This class inherits a constructor from ActiveModel::BetterErrors::Formatter
Instance Method Details
#format_message ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/active_model/better_errors/human_message_formatter.rb', line 9 def return if keys = i18n_keys key = keys.shift = { default: keys, model: base.class.model_name.human, attribute: base.class.human_attribute_name(attribute), value: value }.merge(self.) I18n.translate key, end |