westonganger / active_snapshot

Simplified snapshots and restoration for ActiveRecord models and associations with a transparent white-box implementation
MIT License
103 stars 16 forks source link

fix: Sub classes of a model would not be assigned correctly as parent when reifying #18

Closed PhilT closed 2 years ago

PhilT commented 2 years ago

Parent currently compared on exact type. This PR ensures the parent matches on a subclass aka is_a?.

Covered with a simple test.

It looks like the data isn't wiped after each test so if you'd prefer I move the creation of SubPost to the test_helper, let me know.