Forum: Ruby on Rails Class Caching Problem [was Newbie Question about Custom Clas

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F2a8e4cc069558b818508c80052f2f5e?d=identicon&s=25 Brent Johnson (Guest)
on 2006-03-22 15:19
(Received via mailing list)
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
1fba4539b6cafe2e60a2916fa184fc2f?d=identicon&s=25 unknown (Guest)
on 2006-03-22 15:28
(Received via mailing list)
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

>>
>> - 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
F2a8e4cc069558b818508c80052f2f5e?d=identicon&s=25 Brent Johnson (Guest)
on 2006-03-22 15:38
(Received via mailing list)
> 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

Shew, 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
27c170f482104299af279902be0a9c26?d=identicon&s=25 Trevor Squires (Guest)
on 2006-03-22 15:51
(Received via mailing list)
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
F2a8e4cc069558b818508c80052f2f5e?d=identicon&s=25 Brent Johnson (Guest)
on 2006-03-22 16:07
(Received via mailing list)
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
E3c79c779c0b390049289cdfe7cb9705?d=identicon&s=25 Bob Hutchison (Guest)
on 2006-03-22 16:35
(Received via mailing list)
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.

>>
>> HTH,
>>> being
>>>
>>>> Thanks,
>> 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/>
This topic is locked and can not be replied to.