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

For single-table-inheritance tables, the 'type' column doesn't get copied. #2

Open
unixmonkey opened this issue May 21, 2010 · 2 comments

Comments

@unixmonkey
Copy link

Type is a reserved word, so setting it in model.attributes doesn't work.
Adding the following line just above new_model.id = model.id should do the trick:
new_model[:type] = model[:type] if model[:type].present?

@mlc
Copy link

mlc commented May 26, 2010

My fork at http://github.com/mlc/rails_db_convert_using_adapters should solve this issue as well, albeit in a different manner.

@unixmonkey
Copy link
Author

@mlc: it does not, as sqlite doesn't support the syntax of INSERT INTO with multiple values, it would have to be a new insert for each row.

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

2 participants