How do you delete an ActiveRecord object?
I looked at Active Record Querying and it does not have anything on deleting that I can see.
Delete by
User.destroyUser.destroy(1) will delete user with id == 1 and :before_destroy and :after_destroy callbacks occur. For example if you have associated records
has_many :addresses, :dependent => :destroy
After user is destroyed his addresses will be destroyed too. If you use delete action instead, callbacks will not occur.
User.destroy, User.delete
User.destroy_all( or User.delete_all(
Notice: User is a class and user is an instance object