westonganger / paper_trail-association_tracking

Plugin for the PaperTrail gem to track and reify associations
MIT License
128 stars 38 forks source link

Has many reification is broken when custom version association name is set #30

Open stahor opened 3 years ago

stahor commented 3 years ago

https://github.com/westonganger/paper_trail-association_tracking/blob/015422c567f75b6b8de708312b5dc9b7da143437/lib/paper_trail_association_tracking/reifiers/has_many.rb#L104 The line above leads to errors as soon as you customize the version association name. It tries to join ::PaperTrail::VersionAssociation to some a wrong association (e.g. my_custom_version) while it must be just joins(:version) https://github.com/westonganger/paper_trail-association_tracking/blob/015422c567f75b6b8de708312b5dc9b7da143437/lib/paper_trail_association_tracking/version_association_concern.rb#L10

westonganger commented 3 years ago

Ok would you consider creating a PR with test cases for this?