JackDanger / permanent_records

Rails Plugin - soft-delete your ActiveRecord records. It's like an explicit version of ActsAsParanoid
https://jdanger.com
MIT License
272 stars 64 forks source link

Fix NoMethodError for HABTM associations #95

Closed mherold closed 6 years ago

mherold commented 6 years ago

Fixes the NoMethodError in each_counter_cache which occurred as soon as you had a HABTM association. This should fix #94.

Added a HABTM association to the tests. Existing counter cache tests stay green.

Side note: This also might be an alternative to PR #90 (@joel if you meant the same with _reflections giving "wrong associations").

/cc @drakmail @JackDanger

JackDanger commented 6 years ago

Thanks for this, @mherold! This is really helpful. Welcome to the permanent records project! :)