def human_attribute_name(attribute, *args)
s_(gettext_translation_for_attribute_name(attribute))
end
def gettext_translation_for_attribute_name(attribute)
attribute = attribute.to_s
if attribute.ends_with?('_id')
humanize_class_name(attribute)
else
"#{inheritance_tree_root(self)}|#{attribute.split('.').map! {|a| a.humanize }.join('|')}"
end
end
the first method calls the 2nd passing an attribute like chat_id.
As it ends with _id it executes the first if,
the return of humanize_class_name(attribute) is nil.
That cause the undefined method split for nil classes when using with rails validate_uniqueness_of
ActiveModel::Translation
hasthe first method calls the 2nd passing an attribute like
chat_id
.As it ends with _id it executes the first if,
the return of
humanize_class_name(attribute)
is nil.That cause the undefined method split for nil classes when using with rails
validate_uniqueness_of