Is it possible to change the state of a rails application, from production to test? with the possibility of going back to production again
Is it possible to change the state of a rails application, from production to test? with the possibility of going back to production again
The correct thing would be for you to stop the application and then start it already in the test environment, it would not be good practice.
Yes.
RAILS_ENV=<ambiente> <comando>
For example, to run seeding from the test database, do the following:
RAILS_ENV=test rails db:seed
Environments are test
, development
, staging
and production
.
You can run the command below:
RAILS_ENV=test rails s
or
RAILS_ENV=production rails s