Remove counter workaround for #5692 on upgrade to rails 4.x
#5 Updated by Tom Caspy over 5 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.
#13 Updated by Dominic Cleal over 4 years ago
An issue remains in Rails 4 (126.96.36.199, 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.