i have an article model, which when creating a new instance, i am using a virtual attribute technique in order to build the categories associations (categories.build(attrs) for example). the problem is that i have an observer that is supposed to send me an email about any article being created and it's categories, but it seems that in the ActionMailer view, the categories association is empty... so the email is being sent, but with no categories (db shows that they exists!). any idea?
well, i kinda figured out part of the problem, the actual Article#save! triggers first the article instance create, and than the association #create, so the observer triggers when the associations aren't ready yet.
How are you observing the model? Try using after_update or after_save with your observer.