For performance reasons, the generated read method does not use
read_attribute, so I doubt that it will be changed.

Changing both read_attribute and the generated read method to use
read_attribute_before_type_cast gives you a single point where you can
intercept all read methods and shouldn't hit performance to any
noticeable degree.

As Jeremy pointed out, you can simply turn off the generation of read
methods causing read_attribute to always be called, but you lose some
performance.

-Jonathan.

On 5/10/06, Jeffrey Hall <[EMAIL PROTECTED]> wrote:
> But, I don't think that will solve your original problem of needing to
> be able to override the read methods ... ?

Haha - well as far as I can tell, my problem lies only in the fact that the two 
calls are different.  My code works on the first reader call and breaks on any 
successive calls.  If the generated reader methods use read_attribute, then 
there is a single common place to change the behavior of ActiveRecord to read 
attributes.  Savy?

I just was not aware if there is a specific reason they differ.

-- Jeff
_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core

_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to