Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errata: 2.3.2 app_component/engine.rb Formatting Fix Suggestions #2

Open
aaronkelton opened this issue Oct 14, 2018 · 1 comment
Open
Labels
errata Errors or omissions in the book

Comments

@aaronkelton
Copy link

At the end of section 2.3.2 in the eBook, the code is correct, but the formatting was perplexing me for some time. The end for the initializer do..end looks like it closes the class definition. And the 2-space tabbing goes to 3 in the generators block.

I've updated mine to look as follows:

module AppComponent
  class Engine < ::Rails::Engine
    isolate_namespace AppComponent

    initializer :append_migrations do |app|
      unless app.root.to_s.match(root.to_s+File::SEPARATOR)
        app.config.paths["db/migrate"].concat(
            config.paths["db/migrate"].expanded)
      end
    end

    config.generators do |g|
      g.orm             :active_record
      g.template_engine :slim
      g.test_framework  :rspec
    end
  end
end
@shageman
Copy link
Owner

shageman commented Nov 5, 2018

In the printed version of the book the end in line 10 isn't properly indented. Otherwise, it looks exactly like @chemturion's version.

Thanks!

@shageman shageman added the errata Errors or omissions in the book label Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
errata Errors or omissions in the book
Projects
None yet
Development

No branches or pull requests

2 participants