ActiveRecord::insert() and ActiveRecord::update() refactoring

The diff is not very clearly reflects the situation. See plain file.