unable to get "has_many :after_add" to work - need help

Can someone tell me what I'm doing wrong? I've spent way too much time on this

p.ratings.create(:amount => 5) didn't work either... any other thoughts on how to make this work?

I did think about using after_create in the Rating model (and will end up doing that if I can't get this to work) but it makes more sense in my head to have an :after_add in the Picture model. Does :after_add just not work or am I missing something?

I think you were almost there the first try.

script/console p = Picture.create(:title => 'p02') r = Rating.create(:amount => 5) p.ratings << r

The after_add is only fired when using the << function to add the object to the collection.

--nkryptic