Permalink
Browse files

Inline a method used by render_partial. Closes #2881.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3073 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 60e425a commit e9a4e4d88b6377ce1b6167149ea45767018dac65 @jeremy jeremy committed Nov 17, 2005
Showing with 6 additions and 9 deletions.
  1. +6 −9 actionpack/lib/action_view/partials.rb
@@ -117,15 +117,12 @@ def add_counter_to_local_assigns!(partial_name, local_assigns)
end
def add_object_to_local_assigns!(partial_name, local_assigns, object)
- local_assigns[partial_name.intern] ||= unwrap_object(object) || controller.instance_variable_get("@#{partial_name}")
- end
-
- def unwrap_object(object)
- if object.is_a?(ActionView::Base::ObjectWrapper)
- object.value
- else
- object
- end
+ local_assigns[partial_name.intern] ||=
+ if object.is_a?(ActionView::Base::ObjectWrapper)
+ object.value
+ else
+ object
+ end || controller.instance_variable_get("@#{partial_name}")
end
end
end

0 comments on commit e9a4e4d

Please sign in to comment.