Closed flash-gordon closed 4 years ago
As of now, when tuples are compared in the update changeset, original may be a struct when the relation is used in a repo: https://github.com/rom-rb/rom/blob/212ccab204c49b64f8d81e03b6b3dc7c041d1182/changeset/lib/rom/changeset/update.rb#L68 This leads to implicit coercion to a hash. Since we plan to remove Struct#to_hash in dry-struct 2.0, it'll bring incompatibility. Fortunately, something as simple as
original
Struct#to_hash
def original @original ||= relation.with(auto_struct: false).one end
may do the trick.
As of now, when tuples are compared in the update changeset,
original
may be a struct when the relation is used in a repo: https://github.com/rom-rb/rom/blob/212ccab204c49b64f8d81e03b6b3dc7c041d1182/changeset/lib/rom/changeset/update.rb#L68 This leads to implicit coercion to a hash. Since we plan to removeStruct#to_hash
in dry-struct 2.0, it'll bring incompatibility. Fortunately, something as simple asmay do the trick.