I’ve got this in my en.yml:
activerecord:
attributes:
my_model:
my_attr: "BLUBO"
errors:
models:
my_model:
format: "%{message}"
attributes:
my_attr:
my_error: "Hello hello"
I expect the full message for the validation error to be only “Hello hello”, but it is “BLUBO Hello hello”. Why is Rails ignoring my custom format?
Edit: it makes no difference if I move the “format” inside the attribute, like this:
errors:
models:
my_model:
attributes:
my_attr:
format: "%{message}"
my_error: "Hello hello"
Edit 2: Perhaps I should clarify that I am adding this error to my model through a custom validation with errors.add(:my_attr, :my_error)
.