We're updating a Rails 6.1 application to 7.1. We're running into an issue with a table that has a trigger to generate a primary key on insert, which should be populated back into the model using RETURNING INTO.
We're finding that that's not working, due to the checks for the primary key type in sql_for_insert.
Our model defines primary key as:
self.primary_key = :rid
By the time the sql_for_insert method is invoked though, pk is of type String, so this code never inserts the RETURNING INTO sql.
It seems like this was a change (the check for pk being a string) introduced with the move to 7, but I can't find incidents of other people encountering an issue here. Anyone have thoughts?
We're updating a Rails 6.1 application to 7.1. We're running into an issue with a table that has a trigger to generate a primary key on insert, which should be populated back into the model using
RETURNING INTO.We're finding that that's not working, due to the checks for the primary key type in sql_for_insert.
Our model defines primary key as:
self.primary_key = :ridBy the time the sql_for_insert method is invoked though, pk is of type String, so this code never inserts the
RETURNING INTOsql.It seems like this was a change (the check for pk being a string) introduced with the move to 7, but I can't find incidents of other people encountering an issue here. Anyone have thoughts?