Is there a Rails Console command (Rails 3+) to reload changed code?
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?
Of course, simply type:
reload!
You need to call reload!
This command will clear the loaded constants that have been loaded and will load them as they're referenced in the console.
If you have old objects from before the reload!
you will need to call reload
on these individual objects or find new objects and work with them if you want to try out the new method.