Hi --

On Thu, 24 Sep 2009, Frederick Cheung wrote:

>
>
>
> On Sep 23, 11:27 pm, MaggotChild <[email protected]> wrote:
>> Could someone explain this?
>>
>
> At a quick glance it is probably because after AttributeMethods is
> included in ActiveRecord::Base, write_attribute is aliased &
> overwridden (eg the change tracking module). You then change
> write_attribute on AttributeMethods but it is too late - the aliasing
> that occured in Dirty is pointing at the previous implementation.

This thread seems to be going on both here and in ruby-talk. See my
most recent answer in ruby-talk; there is, indeed an
alias_method_chain call involving write_attribute (but not
read_attribute) that happens before the initializer is executed.


David

-- 
David A. Black, Director
Ruby Power and Light, LLC (http://www.rubypal.com)
Ruby/Rails training, consulting, mentoring, code review
Book: The Well-Grounded Rubyist (http://www.manning.com/black2)
--~--~---------~--~----~------------~-------~--~----~
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 [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-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to