peter.fitzgibbons-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Oct-25 13:58 UTC
extend AR to handle legacy fieldname casing
Hello all, I''m hoping one of you has already done this, or just has the metaprogramming-fu that I don''t. I want to extend ActiveRecord::Base#method_missing to try matching the columns with downcase if the case-sensitive match fails. For instance, fieldname ''LotsaLuck'' fails if accessed with Mymodel.lotsaluck NoMethodError: undefined method `lotsaluck'' for #<Mymodel:0x58160dc> I think maybe the alternative is a way to switch on downcasing in the connection_adapter when it gets the columns collection ? Thanks for any help you may have! Peter Fitzgibbons -- ------------------------------ Apple MacBook. Black. It''s the new White! ------------------------------ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---