has_many :through and callbacks

Reading this a little bit earlier would have saved me a lot of time. In short: callbacks such as :before_add does not work with has_many :through, and the documentation does not tell you that. To get callbacks, add them to the join model.

  • del.icio.us
  • Digg
  • description
  • Technorati
  • Reddit

One Response to “has_many :through and callbacks”

  1. Ross Says:

    Oh FFS! That’s at the rails docs and not you. You get a “I wish I’d read that sooner as well”.

    Thanks!

Leave a Reply