Have you seen these errors?
NoMethodError: undefined method `columns_hash' for "":String
NoMethodError: undefined method `private_method_defined?' for "":String
If you’ve tried using Rails 3 with a legacy database, it is possible you’ve run across issues with some of your columns having the same name as existing methods of instances of ActiveRecord::Base. My primary example of this has been columns with the name ‘class’. If you can’t change the column name to be ‘klass’ or ‘clazz’, then you may want to consider my solution to this issue.
I’ve created a gem called safe_attributes that turns off the creation of the attribute accessors that conflict with existing instance methods of ActiveRecord::Base.
https://github.com/bjones/safe_attributes
https://rubygems.org/gems/safe_attributes
Pingback: Legacy Column Names in Rails 3 « Kansas City on Rails
Great article, Bryan! I expanded on your post in my own blog (giving you credit, of course), with example code and a downloadable sample app:
Legacy Database Column Names in Rails 3
More importantly, thank you for digging in and creating a nice solution to this problem. I’m sure it’ll help a lot of people, and might be worth submitting to the rails core itself.