开发者

How do you reload your environment while using script/console?

开发者 https://www.devze.com 2022-12-31 16:30 出处:网络
I think I have seen Ryan Bates do it one of his screencasts, but I can\'t find it. I believe there is a command you can run while in script/console that lets you reload your models (if say you have m

I think I have seen Ryan Bates do it one of his screencasts, but I can't find it.

I believe there is a command you can run while in script/console that lets you reload your models (if say you have made a change) so that you dont have to exit and then recall the console.

An开发者_如何学编程y Ideas?


Just use:

reload!

However, do note that this won't reflect the changes on the models that are already instantiated in your console. To reflect changes in already instantiated models, you may visit this answer.


If you are using rspec use

load 'some_class.rb'
0

精彩评论

暂无评论...
验证码 换一张
取 消