aboutsummaryrefslogtreecommitdiffstats
path: root/guides/rails_guides
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2019-01-29 15:17:52 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2019-01-29 15:49:40 -0800
commite17fe52e0e0ef0842b6c409e1110a862c4e005bc (patch)
treefcc3617c202d873ffed4d99844fbd7d6f6712cd0 /guides/rails_guides
parent94d54fa4ab641a0ddeb173409cb41cc5becc02a9 (diff)
downloadrails-e17fe52e0e0ef0842b6c409e1110a862c4e005bc.tar.gz
rails-e17fe52e0e0ef0842b6c409e1110a862c4e005bc.tar.bz2
rails-e17fe52e0e0ef0842b6c409e1110a862c4e005bc.zip
Tighten up the AV::Base constructor
The AV::Base constructor was too complicated, and this commit tightens up the parameters it will take. At runtime, AV::Base is most commonly constructed here: https://github.com/rails/rails/blob/94d54fa4ab641a0ddeb173409cb41cc5becc02a9/actionview/lib/action_view/rendering.rb#L72-L74 This provides an AV::Renderer instance, a hash of assignments, and a controller instance. Since this is the common case for construction, we should remove logic from the constructor that handles other cases. This commit introduces special constructors for those other cases. Interestingly, most code paths that construct AV::Base "strangely" are tests.
Diffstat (limited to 'guides/rails_guides')
-rw-r--r--guides/rails_guides/generator.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/rails_guides/generator.rb b/guides/rails_guides/generator.rb
index fd33c3f8a7..b0ddb0e7e0 100644
--- a/guides/rails_guides/generator.rb
+++ b/guides/rails_guides/generator.rb
@@ -150,8 +150,8 @@ module RailsGuides
puts "Generating #{guide} as #{output_file}"
layout = @kindle ? "kindle/layout" : "layout"
- view = ActionView::Base.new(
- @source_dir,
+ view = ActionView::Base.with_view_paths(
+ [@source_dir],
edge: @edge,
version: @version,
mobi: "kindle/#{mobi}",