aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib
diff options
context:
space:
mode:
authorSeb Jacobs <me@sebjacobs.com>2019-03-13 17:04:30 +0000
committerSeb Jacobs <me@sebjacobs.com>2019-03-15 20:31:24 +0000
commit47fea39ed6b01b0f8c440f94e694519ec677ae4c (patch)
treedf5991035fa4d6756723f90d4a26bf0cba4cd066 /actionview/lib
parent1cdc6c6576afe9a9fa67a6b313080a7dc62188d9 (diff)
downloadrails-47fea39ed6b01b0f8c440f94e694519ec677ae4c.tar.gz
rails-47fea39ed6b01b0f8c440f94e694519ec677ae4c.tar.bz2
rails-47fea39ed6b01b0f8c440f94e694519ec677ae4c.zip
Rename `ActionView::Base#run` to `#_run`
There was a recent change by @tenderlove to Action view which introduced `ActionView::Base#run` [1]. We ran into an issue with our application because one of the core concepts in our domain model is a `Run` which is exposed in most of our views as a helper method, which now conflicts with this new method. Although this is a public method it is not really meant to be part of the public API. In order to discourage public use of this method and to reduce the chances of this method conflicting with helper methods we can prefix this method with an underscore, renaming this method to `_run`. [1] https://github.com/rails/rails/commit/c740ebdaf5
Diffstat (limited to 'actionview/lib')
-rw-r--r--actionview/lib/action_view/base.rb2
-rw-r--r--actionview/lib/action_view/template.rb2
-rw-r--r--actionview/lib/action_view/template/handlers/erb/erubi.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/actionview/lib/action_view/base.rb b/actionview/lib/action_view/base.rb
index cf71b4803b..5253ef7b0c 100644
--- a/actionview/lib/action_view/base.rb
+++ b/actionview/lib/action_view/base.rb
@@ -267,7 +267,7 @@ module ActionView #:nodoc:
_prepare_context
end
- def run(method, template, locals, buffer, &block)
+ def _run(method, template, locals, buffer, &block)
_old_output_buffer, _old_virtual_path, _old_template = @output_buffer, @virtual_path, @current_template
@current_template = template
@output_buffer = buffer
diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb
index 2c27e11b9e..a3e0be27bc 100644
--- a/actionview/lib/action_view/template.rb
+++ b/actionview/lib/action_view/template.rb
@@ -173,7 +173,7 @@ module ActionView
def render(view, locals, buffer = ActionView::OutputBuffer.new, &block)
instrument_render_template do
compile!(view)
- view.run(method_name, self, locals, buffer, &block)
+ view._run(method_name, self, locals, buffer, &block)
end
rescue => e
handle_render_error(view, e)
diff --git a/actionview/lib/action_view/template/handlers/erb/erubi.rb b/actionview/lib/action_view/template/handlers/erb/erubi.rb
index 247b6d75d1..307b852440 100644
--- a/actionview/lib/action_view/template/handlers/erb/erubi.rb
+++ b/actionview/lib/action_view/template/handlers/erb/erubi.rb
@@ -27,7 +27,7 @@ module ActionView
include action_view_erb_handler_context._routes.url_helpers
class_eval("define_method(:_template) { |local_assigns, output_buffer| #{src} }", @filename || "(erubi)", 0)
}.empty
- view.run(:_template, nil, {}, ActionView::OutputBuffer.new)
+ view._run(:_template, nil, {}, ActionView::OutputBuffer.new)
end
private