On 7/24/07, inkling <[EMAIL PROTECTED]> wrote:
>
> I've noticed that because of the query_cache, if you write the value
> of an attribute on an ActiveRecord object, the object will continue to
> have that "dirty" value even if you ".reload" the object or try and
> fetch it again from the DB.  Here's an example in a test case.  You
> could stick this in QueryCacheExpiryTest:

The query cache stores the returned attributes in a class variable
(Task.query_cache.instance_variable_get(:@query_cache).  Modifying an
attribute modifies that same hash, which is why #reload doesn't change
anything.

Please open up a ticket with the failing test patch.  I don't think
modifying #write_attribute is the way to go though.

-- 
Rick Olson
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to