If the capitalised method names are giving you trouble you could forgo the sugar and just use the attributes hash. Not quite as clean, but may save some trouble.
@obj.attributes["Last_Name"] -Brad On Mon, Mar 16, 2009 at 4:18 PM, Glenn Little <[email protected]> wrote: > > We've just run into a situation where an outside database we talk to has > changed its schema for one of its tables. Among the potential issues > is that a bunch of the column names now start with capital letters. > > Changing our references accordingly *seems* to work. ActiveRecord > is now giving us > > ForeignTable#Last_Name() > > instead of > > ForeignTable#last_name. > > But I noticed that the IDE is now treating Last_Name like a constant > (because of the initial cap) and I got to wondering if we weren't going > to be shooting ourselves in the foot somewhere down the line by naming > our ActiveRecord model objects using the conventions normally used for > contants. > > Note that this database is not in our control, so we can't do anything > about the name changes. > > Any caveats or issues with this that I may be missing, or maybe a way > to tell ActiveRecord to ignore capitalization for a given table? > > Thanks... > > -glenn > > > > > --~--~---------~--~----~------------~-------~--~----~ SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby -~----------~----~----~----~------~----~------~--~---
