You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be cool to add a generator that puts config/initializers/dev_toolbar.rb into place.
Even cooler would be if it checked for the presence of a few gems and, if detected, prepopulated the config; e.g. if rails_db gem is present, then add a link to /rails/db.
The text was updated successfully, but these errors were encountered:
I noticed that for our Rails projects which all have this line in the `bin/setup` script:
```
bundle exec rake db:create RAILS_ENV=test
```
setup fails with this error when the `config/initializers/dev_toolbar.rb` is not wrapped in a development environment check:
```
== Creating test database ==
rake aborted!
NameError: uninitialized constant DevToolbar (NameError)
DevToolbar.configure do |config|
^^^^^^^^^^
```
That surprised me given that the `call` method in the gem currently has a check for `Rails.env.development?`
---
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 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](https://github.com/firstdraft/project-syncing), it will be easy to fix this later on across the projects that are using the `dev_toolbar` gem.
It would be cool to add a generator that puts
config/initializers/dev_toolbar.rb
into place.Even cooler would be if it checked for the presence of a few gems and, if detected, prepopulated the config; e.g. if rails_db gem is present, then add a link to
/rails/db
.The text was updated successfully, but these errors were encountered: