diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-03-16 20:12:04 -0300 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-03-16 16:20:10 -0700 |
commit | 0c1ac36ccb7d72f3d17d950d030442a7e83d0708 (patch) | |
tree | 87bcfb439573fa7d6eb8565ea47756d5e43047bc /actionpack/lib | |
parent | 7a5da2148140eb6824e283d7100727f7227a071e (diff) | |
download | rails-0c1ac36ccb7d72f3d17d950d030442a7e83d0708.tar.gz rails-0c1ac36ccb7d72f3d17d950d030442a7e83d0708.tar.bz2 rails-0c1ac36ccb7d72f3d17d950d030442a7e83d0708.zip |
scope_key_by_partial fix for Ruby 1.9 when there's virtual_path [#4202 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/translation_helper.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/translation_helper.rb b/actionpack/lib/action_view/helpers/translation_helper.rb index 26ba4e2ca4..457944dbb6 100644 --- a/actionpack/lib/action_view/helpers/translation_helper.rb +++ b/actionpack/lib/action_view/helpers/translation_helper.rb @@ -29,9 +29,10 @@ module ActionView private def scope_key_by_partial(key) - if (key.respond_to?(:join) ? key.join : key.to_s).first == "." + strkey = key.respond_to?(:join) ? key.join : key.to_s + if strkey.first == "." if @_virtual_path - @_virtual_path.gsub(%r{/_?}, ".") + key.to_s + @_virtual_path.gsub(%r{/_?}, ".") + strkey else raise "Cannot use t(#{key.inspect}) shortcut because path is not available" end |