I have a legacy DB I’m using. To make Rails work, I’m explicitly setting
primary key names, etc. However, it strikes me that there is consistency
in the table naming, just not Rails compliant. I recall seeing ways to
tell Rails how to look for table names, column names, etc., and I was
wondering if I could save a lot of typing by setting some application
level prefs and letting Rails do the work.
To wit:
-
Table names are not pluralized, so the users’ table is named “user”.
-
Primary keys are of the form [Tablename]ID, so the users’ table has a
primary key named “UserID”. -
Foreign keys use the same convention, so the foreign key referencing
users in the group table is “UserID”.
Can any of this be handled with configuration?