Module: Russian::ActiveModelExt::ErrorPatch
- Defined in:
- lib/russian/active_model_ext/custom_error_message.rb
Overview
Patch for ActiveModel::Error.full_message.
Validation messages prefixed with ^ suppress the humanized
attribute name in the resulting full message.
Патч для ActiveModel::Error.full_message.
Сообщения валидации с префиксом ^ подавляют humanized-имя
атрибута в итоговом полном сообщении.
Instance Method Summary collapse
-
#full_message(attribute, message, base) ⇒ String
Builds a full validation message and optionally suppresses the attribute name when the message starts with
^.
Instance Method Details
#full_message(attribute, message, base) ⇒ String
Builds a full validation message and optionally suppresses the
attribute name when the message starts with ^.
Строит полное сообщение валидации и при необходимости подавляет имя
атрибута, если сообщение начинается с ^.
37 38 39 40 41 |
# File 'lib/russian/active_model_ext/custom_error_message.rb', line 37 def (attribute, , base) return super unless suppress_attribute_name?(attribute, ) .to_s.delete_prefix("^") end |