Perhaps there is a better solution than just updating the README to point out this requirement, however, on #8, there is already planned work to create a generator for the initializer. During that work, we can investigate this more deeply, but for now, since we need this working ASAP for class, I think we just need this instruction in the README and to have all the initializers use this slight hack.
Since all initializers will be uniform across our Rails projects and managed with the project-syncing tool, it will be easy to fix this later on across the projects that are using the dev_toolbar gem.
[!IMPORTANT]
Wraps DevToolbar.configure in a development check to prevent test database creation errors, updating README.md accordingly.
Behavior:
Wraps DevToolbar.configure in config/initializers/dev_toolbar.rb with if Rails.env.development? to prevent errors during test database creation.
Documentation:
Updates README.md to include the development environment check in the configuration example.
This description was created by for f47a9f20f97903970d1cac916ab4d83d548e3268. It will automatically update as commits are pushed.
I noticed that for our Rails projects which all have this line in the
bin/setup
script:setup fails with this error when the
config/initializers/dev_toolbar.rb
is not wrapped in a development environment check:That surprised me given this code in the gem:
https://github.com/firstdraft/dev_toolbar/blob/4acbc33a0dcdb57985af51ca9a4cd58b23fc491e/lib/dev_toolbar/middleware.rb#L10
Perhaps there is a better solution than just updating the README to point out this requirement, however, on #8, there is already planned work to create a generator for the initializer. During that work, we can investigate this more deeply, but for now, since we need this working ASAP for class, I think we just need this instruction in the README and to have all the initializers use this slight hack.
Since all initializers will be uniform across our Rails projects and managed with the project-syncing tool, it will be easy to fix this later on across the projects that are using the
dev_toolbar
gem.