fix attribute translation for activerecord using STI having with both singular(one) and plural(other) translation keys

This commit is contained in:
andreas 2014-09-22 15:38:37 +03:00
parent 9f284cb98a
commit 8460f8f5c8
1 changed files with 3 additions and 2 deletions

View File

@ -135,8 +135,9 @@ module Ransack
end
def self.translated_attribute(associated_class)
"#{associated_class.i18n_scope}.attributes.#{
i18n_key(associated_class)}.#{@attr_name}".to_sym
key = "#{associated_class.i18n_scope}.attributes.#{
i18n_key(associated_class)}.#{@attr_name}"
["#{key}.one".to_sym, key.to_sym]
end
def self.translated_ancestor_attributes