Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom column names #16

Open
timsaunders-vogogo opened this issue Sep 27, 2014 · 2 comments
Open

Custom column names #16

timsaunders-vogogo opened this issue Sep 27, 2014 · 2 comments

Comments

@timsaunders-vogogo
Copy link

Is there a way I can define the names of the columns (actable_id, actable_type), to whatever names I like? I have a legacy multiple table inheritance database, and am unable to change the column names. Is there a way I can change the columns to 'some_id_name' and 'a_different_type_name', instead of actable_id and actable_type?

Also, I can't declare as: on the actable and acts_as, since they have different leading names.

@hzamani
Copy link
Owner

hzamani commented Oct 7, 2014

You can use names as in references migration method with :as option. For example:

actable as: :some_name

will produce some_name_id and some_name_type columns.
There is not any method to use fully custom names.

@hickscorp
Copy link

This issue should be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants