1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Destroy rich text dependents

This commit is contained in:
David Heinemeier Hansson 2018-05-29 16:12:28 +02:00
parent 3a515bb308
commit a79fa9d223

View file

@ -14,7 +14,7 @@ module ActionText
end
CODE
has_one :"rich_text_#{name}", -> { where(name: name) }, class_name: "ActionText::RichText", as: :record, inverse_of: :record, dependent: false
has_one :"rich_text_#{name}", -> { where(name: name) }, class_name: "ActionText::RichText", as: :record, inverse_of: :record, dependent: :destroy
scope :"with_rich_text_#{name}", -> { includes("rich_text_#{name}") }