I\'d like the code in one of my initializers (in config/initializers/) to be run only for the :development environment, but not :test
config/initializers/
:development
:test
I'm pretty sure your only two options are putting the configuration code in config/environments/development.rb or wrapping your initializer code with your if block. You can tighten up your second option by doing if Rails.env.development?, though.
config/environments/development.rb
if
if Rails.env.development?