Active Record callbacks.