dependent to destroy

This commit is contained in:
Bomrah Harry 2019-05-05 20:47:11 +08:00
parent 02e905b630
commit 98734d9e2d
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ class Banner
field :width, type: Integer
field :base_image, type: Integer, default: 1
has_many :ad_images , dependent: :delete
has_many :ad_images , dependent: :destroy
validates_uniqueness_of :title
validates :title, :length => { :minimum => 2 }