Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 323
aarona Avatar asked May 24 '10 16:05

aarona


2 Answers

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.

like image 147
Slobodan Kovacevic Avatar answered Nov 14 '22 04:11

Slobodan Kovacevic


If you are using rspec use

load 'some_class.rb'
like image 20
Sachin L S Avatar answered Nov 14 '22 06:11

Sachin L S