how to have ruby console recognize code changes in controllers and models
I'm adding new functionality to my ruby model and testing it through the ruby console as I go. I find it very annoying to have to restart the console everytime I change anything in the model. Is there a way to have the ruby console not cache or have it check for updated code without restarting it?
For example, I'm making a new method in the model, and after I make a change, I have to restart the console and run a few commands to load everything back up again. See below:
script/console
require 'some_gem'
r = Region.find_by_name("some_region")
r.some_method
If I change a line in the high_x method from the region model, I have to repeat all of the steps to see my chang开发者_运维问答e.
Just type:
reload!
This will ... reload :)
精彩评论