rails dependent: :destroy code example Example: active record dependent destroy has_many :books, dependent: :destroy