aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/renderer/partial_renderer.rb
diff options
context:
space:
mode:
authorTieg Zaharia <tieg@kickstarter.com>2012-04-16 15:33:15 -0400
committerTieg Zaharia <tieg@kickstarter.com>2012-04-16 15:33:15 -0400
commit5d8d639f0086aff5cb63587b629968f8439d65d7 (patch)
tree2ace1c24b433a2a48849a8e0e9c03845922001ac /actionpack/lib/action_view/renderer/partial_renderer.rb
parentdfab28b2ca28b477f83befbba639adb6d15c8ce0 (diff)
downloadrails-5d8d639f0086aff5cb63587b629968f8439d65d7.tar.gz
rails-5d8d639f0086aff5cb63587b629968f8439d65d7.tar.bz2
rails-5d8d639f0086aff5cb63587b629968f8439d65d7.zip
converting some tests to assert_raises, and DRY'ing retrieve_variable changes
Diffstat (limited to 'actionpack/lib/action_view/renderer/partial_renderer.rb')
-rw-r--r--actionpack/lib/action_view/renderer/partial_renderer.rb2
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 4d57a8f033..34ea06c9cf 100644
--- a/actionpack/lib/action_view/renderer/partial_renderer.rb
+++ b/actionpack/lib/action_view/renderer/partial_renderer.rb
@@ -451,7 +451,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