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.
Brent J. (Guest)
on 2006-03-22 16: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
unknown (Guest)
on 2006-03-22 16:28
(Received via mailing list)
Hi --

On Wed, 22 Mar 2006, Brent J. 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
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>

--
David A. Black (removed_email_address@domain.invalid)
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 J. (Guest)
on 2006-03-22 16: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
Trevor S. (Guest)
on 2006-03-22 16: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 S.
http://somethinglearned.com
Brent J. (Guest)
on 2006-03-22 17: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
Bob H. (Guest)
on 2006-03-22 17:35
(Received via mailing list)
On Mar 22, 2006, at 10:06 AM, Brent J. 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
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails

----
Bob H.                  -- 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.