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

2

13

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.

Any Ideas?

Ynes answered 24/5, 2010 at 16:45 Comment(0)
M
24

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.

Malarkey answered 24/5, 2010 at 16:53 Comment(0)
A
1

If you are using rspec use

load 'some_class.rb'
Analogical answered 31/3, 2017 at 13:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.