Brian Hogan
2006-Mar-28 14:26 UTC
[Rails] ActiveRecord and columns with spaces or strange characters
I''m interested in modifying ActiveRecord to do some column name transformations. Right now I have a database with some interesting column names... sequence computername part # warrany exp. date ActiveRecord doesn''t even complain about these columns... in fact, I can load data just fine. However, I can''t retrieve data from the ''part #'' field or the "warranty exp. date" field because the methods are not found. Most likely, they can''t be built automatically by active record. Can someone guide me a bit on how I would go about addressing this issue? I''m not entirely sure how the automatic mapping lifecycle works so I don''t know where to insert code to do some translations. I would assume that I have to do translations on the reader methods as well as the writer methods. Help would be much appreciated! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060328/ee10f6f3/attachment.html