belongs_to callbacks

Today I discovered there are callbacks on associations and was pretty excited for the benefits. I was looking for a solution to run some code when adding and removing the audio record from a podcast episode.

After reading the association guide, it looked like it would work with belongs_to. After getting an error, I found https://github.com/rails/rails/issues/586.

I’d be willing to create a PR for it if I can figure it out, but I wanted to check to make sure it’s something that’s still wanted. The workaround mentioned in the issue seems hacky. It’s also something you’d expect to exist if you already had been using callbacks with has_many.

Let me know your thoughts.

Thanks,

Tom