Hey, I've got a following scenario: Reply has_many :venues, :through => :venue_suggestions. When user answers to a question he can add venues to it as suggestions. The problem is that these venues (actually their IDs) are added to the reply form, before the reply is created. Wnever a venue is added or removed from a reply, I'd like to call a function that updates a score of the added venue.
And here's the problem: - I can't use after_add/after_remove callbacks in Reply model, because after_add is called before the reply is actually saved and the associations are not built yet - I can't use after_create/after_destroy callbacks in VenueSuggestion, because after_destroy callback is never called. Looking at the code in Rails 2.3.8 branch it seems that doing something like this: reply.venue_ids = [] calls delete_all, which doesn't call any callbacks. In Rails 3 it works in the same way. So I guess I'm left with after_create and after_remove callbacks in 2 models... Does anyone have any idea how these callbacks should actually work in has_many :through association? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.