Thursday, February 21, 2008

require and load won't reload the file with reload! in rails console

I have the statement "require 'primary_user' " in one of my models of my Rails application. Usually whenever I do a 'reload!' in my rails console, it reloads all the models and their associates files so that any changes to code can be seen in the console. But there is a catch to that reload!. It doesn't reload any of the files loaded using the 'require' statement. So my 'primary_user' file wasn't getting reloaded. Strange. But that's how it works. I tried changing 'require' to 'load' but no use.

No comments: