diff options
author | Tieg Zaharia <tieg@kickstarter.com> | 2012-04-16 15:33:15 -0400 |
---|---|---|
committer | Tieg Zaharia <tieg@kickstarter.com> | 2012-04-16 15:37:51 -0400 |
commit | 6b8dd70083d747535cc35dce176e5afb6ad98177 (patch) | |
tree | 3507d3240538ae7ef31c1b2a91e05ea5d516dfc2 /actionpack/lib | |
parent | dcc11b22828ac2a52f136d00a732a38bd9371a16 (diff) | |
download | rails-6b8dd70083d747535cc35dce176e5afb6ad98177.tar.gz rails-6b8dd70083d747535cc35dce176e5afb6ad98177.tar.bz2 rails-6b8dd70083d747535cc35dce176e5afb6ad98177.zip |
converting some tests to assert_raises, and DRY'ing retrieve_variable changes
Conflicts:
actionpack/test/template/render_test.rb
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/renderer/partial_renderer.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/renderer/partial_renderer.rb b/actionpack/lib/action_view/renderer/partial_renderer.rb index f96b1c6ef3..3093aca91e 100644 --- a/actionpack/lib/action_view/renderer/partial_renderer.rb +++ b/actionpack/lib/action_view/renderer/partial_renderer.rb @@ -407,7 +407,7 @@ module ActionView end def retrieve_variable(path) - variable = @options[:as].try(:to_sym) || path[%r'_?(\w+)(\.\w+)*$', 1].try(:to_sym) + variable = @options.fetch(:as) { path[%r'_?(\w+)(\.\w+)*$', 1] }.try(:to_sym) variable_counter = :"#{variable}_counter" if @collection [variable, variable_counter] end |