Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove unneeded ObjectWrapper class.

Was previously needed to work around the semantics of a deprecated (now removed) API to render :partial
  • Loading branch information...
commit df36a6f7598a7e963fb3d79fb48fd1c073045a43 1 parent efd1806
@NZKoz NZKoz authored
View
2  actionpack/lib/action_controller/base.rb
@@ -897,7 +897,7 @@ def render(options = nil, extra_options = {}, &block) #:doc:
else
render_for_text(
@template.send!(:render_partial, partial,
- ActionView::Base::ObjectWrapper.new(options[:object]), options[:locals]), options[:status]
+ options[:object], options[:locals]), options[:status]
)
end
View
5 actionpack/lib/action_view/base.rb
@@ -199,9 +199,6 @@ module CompiledTemplates #:nodoc:
cattr_reader :computed_public_paths
@@computed_public_paths = {}
- class ObjectWrapper < Struct.new(:value) #:nodoc:
- end
-
def self.helper_modules #:nodoc:
helpers = []
Dir.entries(File.expand_path("#{File.dirname(__FILE__)}/helpers")).sort.each do |file|
@@ -253,7 +250,7 @@ def render(options = {}, local_assigns = {}, &block) #:nodoc:
elsif options[:partial] && options[:collection]
render_partial_collection(options[:partial], options[:collection], options[:spacer_template], options[:locals], options[:as])
elsif options[:partial]
- render_partial(options[:partial], ActionView::Base::ObjectWrapper.new(options[:object]), options[:locals])
+ render_partial(options[:partial], options[:object], options[:locals])
elsif options[:inline]
render_inline(options[:inline], options[:locals], options[:type])
end
View
7 actionpack/lib/action_view/partial_template.rb
@@ -42,12 +42,7 @@ def counter=(num)
private
def add_object_to_local_assigns!(object)
@locals[:object] ||=
- @locals[@variable_name] ||=
- if object.is_a?(ActionView::Base::ObjectWrapper)
- object.value
- else
- object
- end || @view_controller.instance_variable_get("@#{variable_name}")
+ @locals[@variable_name] ||= object || @view_controller.instance_variable_get("@#{variable_name}")
@locals[as] ||= @locals[:object] if as
end
Please sign in to comment.
Something went wrong with that request. Please try again.