30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/couch_i18n/active_model_errors.rb', line 30
def full_message(attribute, message)
return message if attribute == :base
attr_name = attribute.to_s.gsub('.', '_').humanize
attr_name = @base.class.human_attribute_name(attribute, :default => attr_name)
key = (@base.class.model_name.underscore.sub(/\w+$/, '').scan(/\w+/) + ['errors.conjunction.attribute_message']).join('.')
I18n.t(key, {
:default => "%{attribute} %{message}",
:attribute => attr_name,
:message => message
})
end
|