You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it worked fine in Rails 7.0, but in Rails 7.1 when calling id= it expects eg. a Hash, not just the value of id. So, for compatibility I added this:
moduleCompositeKeyCompatibilityextendActiveSupport::Concern# Compatibility override for Rails 7.1 composite key and activerecord-import (1.7.0) gem# When using returning it tries to set id=123, but this method requires a Hash.defid=(value)value=self.class.primary_key.map{ |col| col == 'id' ? value : public_send(col)}unlessvalue.is_a?Enumerablesuperendend
But the library should probably do something similar so that it works out of the box.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this issue. We'll need to ensure backwards compatibility so we'll probably need a version check to make sure this logic is only for AR 7.1+.
I'm thinking we could probably insert some logic in the set_value lambda:
SomeModel
represents partitioned table (bypartition_key
), where primary key is%w[id partition_key]
so when I do this:it worked fine in Rails 7.0, but in Rails 7.1 when calling
id=
it expects eg. aHash
, not just the value ofid
. So, for compatibility I added this:But the library should probably do something similar so that it works out of the box.
The text was updated successfully, but these errors were encountered: