How do you make a Rails migration conditional on the current RAILS_ENV?
Specifically, I want to:
Doing this will allow us to perform database updates - via migrations - which we only want in our Staging environment. An example would be activating a feature for a specific account or class of accounts for testing purposes.
Just use Rails.env.production?
/ Rails.env.<custom-env>?
in your up / down class methods in the Migration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With