how to understand callback and validate_associated

1 after_update callback is wrapped in transaction means:no matter exception occurs during saving an existing record, or in the after_update method body,both the existing record and record manipulation in the after_update body are all rollbacked?

2 class Book < ActiveRecord::Base     has_many :pages     validates_associated :pages     validates_presence_of :name    end

validate_associated means: when i invoke to save book and it's associations,no matter invalidation occurs during saving book self or saving any association,both book and all the associations don't be saved?

I don't understand these from document.can you help me to make it sure? Thanks!

anyone help me?

hi   who know about it? thanks!

hi who know about it? thanks!

Maybe you could rephrase your question - I for one couldn't understand what you were asking


thank! I copy the after_update() doc as following:

I have described the problem clearly.Can you help me?

Correct. The entirety of the save process (validations, before_save, after_save etc.) is wrapped in a single transaction.