Is there a Rails Console command (Rails 3+) to reload changed code?

Viewed 19369

I am playing with the console, I change some model code and now I want to test it. I normally re-start the console. Is there a quicker way? Maybe a console command to reload the model code?

3 Answers

You can type reload!.

I think it's important to note that reload! doesn't reinitialize rails console session existing objects, it just reloads the code:
https://stackoverflow.com/a/10465369/9185715
So, if you have instantiated any objects in the console, they won't be reinitialized.

Related