 |
Forums |
Admin Discussion Forums: help Start New Thread
By: Praveen Devarao
RE: Can't get model attributes [ reply ] 2009-09-16 10:27
|
Hi Szymek,
This is interesting. Specifing your custom table name with small letters will work as expected but specifying the same with capital letters will not.
With the table name in capital letters, the failure is seen even before the metadata function is hit in the adapter. I guess this is because of the conventions to be used, having capital letters in the table name is being interpreted wrongly.
Will try to find out more on this and update you, if any.
Set your custom table name in small letters
class User < ActiveRecord::Base
set_table_name "legacy_user"
end
and you should be able to get the table attributes.
Let me know if you get to find some info on this or need some info.
Thanks
Praveen
|
By: Szymon Nowak
Can't get model attributes [ reply ] 2009-09-16 09:24
|
Hi,
there's a small bug in ibm_db adapter.
Having i.e. model named User with custom table name "LEGACY_USER", if I type "User" in the console, I get "UserTable doesnt exist" result, instead of the list of attributes for User model.
Typing "User.first" correctly returns first record from "LEGACY_USER" table.
Szymek
|
|
 |