Forum: Ruby on Rails ActiveRecord and columns with spaces or strange characters

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6ef8cb7cd7cd58077f0b57e4fa49a969?d=identicon&s=25 Brian Hogan (Guest)
on 2006-03-28 16:26
(Received via mailing list)
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!
This topic is locked and can not be replied to.