On Jun 24, 6:50 am, Jimmy
<jimmy.s...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi,
>
> I''ve got a model with the following attribute added:
>
> attr_accessor :level
>
> which does not exist in the database. After putting instances of this
> model in the cache (using Rails.cache.fetch(''foo'') {
Category.all } ),
> when I retrieve it back from the cache, then trying to access .level
> gives:
>
> undefined method `level'' for #<Category:0x34d50a0>
I suspect rails'' automatic reloading is tripping you up here. If it
works when you enable class caching (in development.rb) then it''s
definitely the automatic reloading.
Fred
>
> I''m simply using the memorystore. In script/console it works fine,
> just not when in script/server. Anybody knows what''s happening
here?
>
> Best regards,
> Jimmy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---