Steve Downey
2005-Jul-03 04:40 UTC
Reloading of Classes not inheriting from ActiveRecord::Base
I have a class that I put in the ../models directory that is not inheriting from ActiveRecord::Base. When running in development mode, changes to the class are not picked up unless I stop/start the server (WEBrick). When I make it inherit from ActiveRecord::Base it changes are picked up. As this class really does not reflect a database table, is there a way to get the benefit of having changes picked up without the (false) inheritance?
Chris McGrath
2005-Jul-03 09:38 UTC
Re: Reloading of Classes not inheriting from ActiveRecord::Base
Use require_dependency rather than require to tell rails to reload the class every request in dev mode. Cheers, Chris On 7/3/05, Steve Downey <sldowney-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:> I have a class that I put in the ../models directory that is not inheriting from > ActiveRecord::Base. When running in development mode, changes to the class are > not picked up unless I stop/start the server (WEBrick). > > When I make it inherit from ActiveRecord::Base it changes are picked up. As > this class really does not reflect a database table, is there a way to get the > benefit of having changes picked up without the (false) inheritance? > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >