Module: Hanami::I18n::Validations::MessageCompiler
- Included in:
- Dry::Validation::MessageCompiler
- Defined in:
- lib/hanami/i18n/validations.rb
Instance Method Summary collapse
Instance Method Details
#message_text(rule, template, tokens, opts) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/hanami/i18n/validations.rb', line 20 def (rule, template, tokens, opts) model_name = (opts.path - [rule]).last rule = ::I18n.t("models.attributes.#{model_name}.#{rule}", default: nil) || ::I18n.t("models.entities.#{rule}", default: nil) || rule super(rule, template, tokens, opts) end |