Skip to content

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

@unixmonkey

Description

@unixmonkey

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions