Brent Johnson
2006-Mar-22 14:19 UTC
[Rails] Class Caching Problem [was Newbie Question about Custom Classes]
So any other ideas as to why my custom class under app/models is being cached even though all the caching is set to false in the config/environments/* files? Currently I''m having to restart WEBrick after EVERY change to the file. The controllers and views are reloading just fine and not being cached. It''s just the custom class I created that''s being cached. Any ideas as to what I should try to get it to stop caching the class? Thanks, - Brent On 3/21/06, Brent Johnson <bljohnson@gmail.com> wrote:> Yep, the filename of the Article model is app/models/article.rb. I''m > still trying to figure out why it''s being cached under WEBrick and > Apache both. > > Thanks, > > - Brent
dblack@wobblini.net
2006-Mar-22 14:28 UTC
[Rails] Class Caching Problem [was Newbie Question about Custom Classes]
Hi -- On Wed, 22 Mar 2006, Brent Johnson wrote:> So any other ideas as to why my custom class under app/models is being > cached even though all the caching is set to false in the > config/environments/* files? Currently I''m having to restart WEBrick > after EVERY change to the file. The controllers and views are > reloading just fine and not being cached. It''s just the custom class > I created that''s being cached. > > Any ideas as to what I should try to get it to stop caching the class?No, but I''m having the same issue. I don''t know that it''s server-determined, but for what it''s worth you can add lighttpd to the list of servers under which it happens :-) David> Thanks, > > - Brent > > On 3/21/06, Brent Johnson <bljohnson@gmail.com> wrote: >> Yep, the filename of the Article model is app/models/article.rb. I''m >> still trying to figure out why it''s being cached under WEBrick and >> Apache both. >> >> Thanks, >> >> - Brent > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- David A. Black (dblack@wobblini.net) Ruby Power and Light, LLC (http://www.rubypowerandlight.com) "Ruby for Rails" chapters now available from Manning Early Access Program! http://www.manning.com/books/black
Brent Johnson
2006-Mar-22 14:38 UTC
[Rails] Class Caching Problem [was Newbie Question about Custom Classes]
> No, but I''m having the same issue. I don''t know that it''s > server-determined, but for what it''s worth you can add lighttpd to the > list of servers under which it happens :-) > > > DavidShew, at least I know I''m not losing my mind then! I''ve grepped for all occurences of the word "cach" to see if there''s any other file which caching parameters and I''ve found nothing other than whats in the environments directory. Thanks for letting me know I''m not the only one! - Brent
Trevor Squires
2006-Mar-22 14:51 UTC
[Rails] Class Caching Problem [was Newbie Question about Custom Classes]
Brent, I may be missing old history on this thread so sorry if I''m asking a question that you''ve already covered: you say "custom class". Does your class inherit from ActiveRecord::Base? If not, and if you''re using Rails1.0 you won''t easily get class reloading. In edge-rails (and the upcoming Rails 1.1) there is a module-mixin called "Reloadable" that will allow you to mark arbitrary classes as reloadable so long as they conform to some file naming conventions. HTH, Trevor -- Trevor Squires http://somethinglearned.com On 22-Mar-06, at 6:19 AM, Brent Johnson wrote:> So any other ideas as to why my custom class under app/models is being > cached even though all the caching is set to false in the > config/environments/* files? Currently I''m having to restart WEBrick > after EVERY change to the file. The controllers and views are > reloading just fine and not being cached. It''s just the custom class > I created that''s being cached. > > Any ideas as to what I should try to get it to stop caching the class? > > Thanks, > > - Brent > > On 3/21/06, Brent Johnson <bljohnson@gmail.com> wrote: >> Yep, the filename of the Article model is app/models/article.rb. I''m >> still trying to figure out why it''s being cached under WEBrick and >> Apache both. >> >> Thanks, >> >> - Brent > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Brent Johnson
2006-Mar-22 15:06 UTC
[Rails] Class Caching Problem [was Newbie Question about Custom Classes]
Aha! You''re correct, the class does not inherit from ActiveRecord::Base. I am indeed using Rails 1.0, so I bet that''s the problem. Thanks for filling me in! - Brent On 3/22/06, Trevor Squires <trevor@protocool.com> wrote:> Brent, > > I may be missing old history on this thread so sorry if I''m asking a > question that you''ve already covered: > > you say "custom class". Does your class inherit from > ActiveRecord::Base? > > If not, and if you''re using Rails1.0 you won''t easily get class > reloading. > > In edge-rails (and the upcoming Rails 1.1) there is a module-mixin > called "Reloadable" that will allow you to mark arbitrary classes as > reloadable so long as they conform to some file naming conventions. > > HTH, > Trevor > -- > Trevor Squires > http://somethinglearned.com > > > > On 22-Mar-06, at 6:19 AM, Brent Johnson wrote: > > > So any other ideas as to why my custom class under app/models is being > > cached even though all the caching is set to false in the > > config/environments/* files? Currently I''m having to restart WEBrick > > after EVERY change to the file. The controllers and views are > > reloading just fine and not being cached. It''s just the custom class > > I created that''s being cached. > > > > Any ideas as to what I should try to get it to stop caching the class? > > > > Thanks, > > > > - Brent > > > > On 3/21/06, Brent Johnson <bljohnson@gmail.com> wrote: > >> Yep, the filename of the Article model is app/models/article.rb. I''m > >> still trying to figure out why it''s being cached under WEBrick and > >> Apache both. > >> > >> Thanks, > >> > >> - Brent > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Bob Hutchison
2006-Mar-22 15:36 UTC
[Rails] Class Caching Problem [was Newbie Question about Custom Classes]
On Mar 22, 2006, at 10:06 AM, Brent Johnson wrote:> Aha! You''re correct, the class does not inherit from > ActiveRecord::Base. I am indeed using Rails 1.0, so I bet that''s the > problem.I got around this by using ''require_dependency'' rather than ''require'' when requiring the file with the custom classes. Seems to work fine for most situations. Apparently this will be replaced in 1.1 with a mixin.> > Thanks for filling me in! > > - Brent > > On 3/22/06, Trevor Squires <trevor@protocool.com> wrote: >> Brent, >> >> I may be missing old history on this thread so sorry if I''m asking a >> question that you''ve already covered: >> >> you say "custom class". Does your class inherit from >> ActiveRecord::Base? >> >> If not, and if you''re using Rails1.0 you won''t easily get class >> reloading. >> >> In edge-rails (and the upcoming Rails 1.1) there is a module-mixin >> called "Reloadable" that will allow you to mark arbitrary classes as >> reloadable so long as they conform to some file naming conventions. >> >> HTH, >> Trevor >> -- >> Trevor Squires >> http://somethinglearned.com >> >> >> >> On 22-Mar-06, at 6:19 AM, Brent Johnson wrote: >> >>> So any other ideas as to why my custom class under app/models is >>> being >>> cached even though all the caching is set to false in the >>> config/environments/* files? Currently I''m having to restart >>> WEBrick >>> after EVERY change to the file. The controllers and views are >>> reloading just fine and not being cached. It''s just the custom >>> class >>> I created that''s being cached. >>> >>> Any ideas as to what I should try to get it to stop caching the >>> class? >>> >>> Thanks, >>> >>> - Brent >>> >>> On 3/21/06, Brent Johnson <bljohnson@gmail.com> wrote: >>>> Yep, the filename of the Article model is app/models/ >>>> article.rb. I''m >>>> still trying to figure out why it''s being cached under WEBrick and >>>> Apache both. >>>> >>>> Thanks, >>>> >>>> - Brent >>> _______________________________________________ >>> Rails mailing list >>> Rails@lists.rubyonrails.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails---- Bob Hutchison -- blogs at <http://www.recursive.ca/ hutch/> Recursive Design Inc. -- <http://www.recursive.ca/> Raconteur -- <http://www.raconteur.info/> xampl for Ruby -- <http://rubyforge.org/projects/xampl/>