Allow to use model name from I18n ransack scope

This commit is contained in:
Tibor Nagy 2015-02-18 17:26:13 +01:00
parent 3e4b6e34ab
commit a6d534d097
2 changed files with 4 additions and 1 deletions

View File

@ -632,6 +632,8 @@ en:
end: ends with
gt: greater than
lt: less than
models:
person: Passanger
attributes:
person:
name: Full Name

View File

@ -59,7 +59,8 @@ module Ransack
defaults =
if key.blank?
[:"#{context.klass.i18n_scope}.models.#{i18n_key(context.klass)}"]
[:"ransack.models.#{i18n_key(context.klass)}",
:"#{context.klass.i18n_scope}.models.#{i18n_key(context.klass)}"]
else
[:"ransack.associations.#{i18n_key(context.klass)}.#{key}"]
end