Remove counter workaround for #5692 on upgrade to rails 4.x
Updated by Tom Caspy over 8 years ago
this can't be removed if we want associations to be updated by the association_id setter.
we get this:
DomainTest#test_0010_should update hosts_count on domain_id change [/Volumes/proj/foreman/test/unit/domain_test.rb:87]:
"domain.hosts_count" didn't change by 1.
when removing this patch.
Updated by Dominic Cleal over 7 years ago
An issue remains in Rails 4 (188.8.131.52, 4.2.5 and master at the time of writing) where counters are double-counted on object reassignment, preventing this workaround from being removed still. Filed as https://github.com/rails/rails/issues/23265.
Unfortunately this means I think that counters are being updated three times on reassignment - twice by Rails and once by our workaround.