Mysql2::Error: Cannot delete or update a parent row: a foreign key constraint fails (`todo_list_development`.`todo_items`, CONSTRAINT `fk_rails_d913ce1c56` FOREIGN KEY (`todo_list_id`) REFERENCES `todo_lists` (`id`)): DELETE FROM `todo_lists` WHERE `todo_lists`.`id` = 4
class Post < ActiveRecord::Base # because we store "Post" in attachable_type now dependent: :destroy will work has_many :assets, as: :attachable, dependent: :destroy end