aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/renderable_partial.rb
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2009-01-30 11:30:27 -0800
committerYehuda Katz <wycats@gmail.com>2009-01-30 11:30:27 -0800
commit3030bc90c95e335d726f06fd7a61ed96055e9109 (patch)
tree5b079250b368f0e8af6d2f72a4278fdab3382b26 /actionpack/lib/action_view/renderable_partial.rb
parentae42163bf5497849e4fcbb736505910c17640459 (diff)
parent85750f22c90c914a429116fb908990c5a2c68379 (diff)
downloadrails-3030bc90c95e335d726f06fd7a61ed96055e9109.tar.gz
rails-3030bc90c95e335d726f06fd7a61ed96055e9109.tar.bz2
rails-3030bc90c95e335d726f06fd7a61ed96055e9109.zip
Merge commit 'rails/3-0-unstable'
Conflicts: actionpack/lib/action_controller/base.rb actionpack/lib/action_dispatch/http/mime_type.rb actionpack/lib/action_dispatch/http/request.rb actionpack/lib/action_view/base.rb actionpack/lib/action_view/paths.rb actionpack/test/controller/session/cookie_store_test.rb actionpack/test/dispatch/rack_test.rb actionpack/test/dispatch/request_test.rb
Diffstat (limited to 'actionpack/lib/action_view/renderable_partial.rb')
-rw-r--r--actionpack/lib/action_view/renderable_partial.rb47
1 files changed, 0 insertions, 47 deletions
diff --git a/actionpack/lib/action_view/renderable_partial.rb b/actionpack/lib/action_view/renderable_partial.rb
deleted file mode 100644
index 3ea836fa25..0000000000
--- a/actionpack/lib/action_view/renderable_partial.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-module ActionView
- # NOTE: The template that this mixin is being included into is frozen
- # so you cannot set or modify any instance variables
- module RenderablePartial #:nodoc:
- extend ActiveSupport::Memoizable
-
- def variable_name
- name.sub(/\A_/, '').to_sym
- end
- memoize :variable_name
-
- def counter_name
- "#{variable_name}_counter".to_sym
- end
- memoize :counter_name
-
- def render(view, local_assigns = {})
- if defined? ActionController
- ActionController::Base.benchmark("Rendered #{path_without_format_and_extension}", Logger::DEBUG, false) do
- super
- end
- else
- super
- end
- end
-
- def render_partial(view, object = nil, local_assigns = {}, as = nil)
- object ||= local_assigns[:object] || local_assigns[variable_name]
-
- if object.nil? && view.respond_to?(:controller)
- ivar = :"@#{variable_name}"
- object =
- if view.controller.instance_variable_defined?(ivar)
- ActiveSupport::Deprecation::DeprecatedObjectProxy.new(
- view.controller.instance_variable_get(ivar),
- "#{ivar} will no longer be implicitly assigned to #{variable_name}")
- end
- end
-
- # Ensure correct object is reassigned to other accessors
- local_assigns[:object] = local_assigns[variable_name] = object
- local_assigns[as] = object if as
-
- render_template(view, local_assigns)
- end
- end
-end