How do I reload my models if I’m in script/console?

Sometimes you’re in script/console and you make a change to your model files, but since Ruby on reads the models when the environment loads, your change isn’t reflected right away in your script/console environment. This will explicitly tell Ruby to reload the environment from scratch. Unfortunately you’ll loose any local variables which were assigned too.

script/console reload!

Leave a Reply

OR LOG IN WITH




Your email address will not be published. Required fields are marked *