rom-rb / rom

Data mapping and persistence toolkit for Ruby
https://rom-rb.org
MIT License
2.08k stars 161 forks source link

[changeset] fix binding map functions in Changeset::Update #592

Closed timriley closed 4 years ago

timriley commented 4 years ago

map blocks defined in ROM::Changeset::Update subclasses should be evaluated in the context of that changeset's instance, however, since the changes in https://github.com/rom-rb/rom/commit/d742f608958a5a6391f53165736f325a64d0066b, they're evaluated in the context of the changeset class.

This breaks ROM's documented behaviour and has caused some issues in an application I help with, which depends on the previous (non-broken) behaviour.

Of the 2 tests added here, only the test using an Update subclass fails, indicating that this behaviour is somehow specific to changesets using that superclass only.