I am struggling with this as well.
What appears to be happening is that the deletes from the join table do
not fire the counter_cache update.
From what I have read, delete's do not fire events and that is the way
it is designed in Rails 4.
I have tried multiple workarounds from doing an after_save event,
putting the join table in it's own model, etc... Nothing I have done
seems to decrement the count.
Anxious to see if any Ruby experts see this post and let us know the
best way to fix this.
John
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0f1af2b3392e7b5539c3a94c5ef1ba97%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment