1
0
Fork 0
mirror of https://github.com/activerecord-hackery/ransack.git synced 2022-11-09 13:47:45 -05:00

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

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