aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2019-01-28 14:12:08 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2019-01-28 14:12:08 -0800
commitbd3bea1598919e177ca6e56d23ae2fc9d8d5e22e (patch)
tree77a85b1507ae55e712d0d32062c86185d509c5ef
parent4ceaf55aea720036356f9e71540449924eef958d (diff)
downloadrails-bd3bea1598919e177ca6e56d23ae2fc9d8d5e22e.tar.gz
rails-bd3bea1598919e177ca6e56d23ae2fc9d8d5e22e.tar.bz2
rails-bd3bea1598919e177ca6e56d23ae2fc9d8d5e22e.zip
Remove `find_template` and `find_file` delegate methods
This reduces the surface area of our API and removes a Liskov issue. Both TemplateRenderer and PartialRenderer inherit from AbstractRenderer, but since PartialRenderer implements it's own `find_template` that is private, and has the wrong method signature, an instance of PartialRenderer cannot be substituted for an instance of AbstractRenderer renderer. Removing the superclass implementation solves both issues.
-rw-r--r--actionview/lib/action_view/renderer/abstract_renderer.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/renderer/abstract_renderer.rb b/actionview/lib/action_view/renderer/abstract_renderer.rb
index 20b2523cac..37f07eabc2 100644
--- a/actionview/lib/action_view/renderer/abstract_renderer.rb
+++ b/actionview/lib/action_view/renderer/abstract_renderer.rb
@@ -17,7 +17,7 @@ module ActionView
# that new object is called in turn. This abstracts the setup and rendering
# into a separate classes for partials and templates.
class AbstractRenderer #:nodoc:
- delegate :find_template, :find_file, :template_exists?, :any_templates?, :with_fallbacks, :with_layout_format, :formats, to: :@lookup_context
+ delegate :template_exists?, :any_templates?, :with_layout_format, :formats, to: :@lookup_context
def initialize(lookup_context)
@lookup_context = lookup_context