On 10 Nov 2008, at 22:22, Jonathan Rochkind wrote:
>
> Okay, I finally figured out what was going on with my mysterious
> migrate-to-Rails2 problem.
>
> In Rails 1.x, I got away with over-riding [] and []= on an
> ActiveRecord::Base model class. This made for some very convenient
> coding, which is now littered all over my application.
>
> In Rails2, you apparently can''t do this.
>
> Should I assume this is right, rather than a bug? Should it be
> documented anywhere?
[]and []= have (as far as I can remember) allowed you to access
attributes (and are documented as such). Overriding public AR methods
is always going to be risky as you may not be the only using them -
Active Record itself may well be using them.>
> Still trying to think through the best least painful way to refactor
> my
> code.
What was your definition of []/[]= ?
Fred
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---