aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2018-05-29 16:12:28 +0200
committerDavid Heinemeier Hansson <david@loudthinking.com>2018-05-29 16:12:28 +0200
commita79fa9d2233be0ac968dbec6c00e8eca5b1d0117 (patch)
tree3f34fa6f591faa41b281567d5ead85be9024ece7 /lib
parent3a515bb3083f5e594b38ee7c9b8e2e755e2c19ac (diff)
downloadrails-a79fa9d2233be0ac968dbec6c00e8eca5b1d0117.tar.gz
rails-a79fa9d2233be0ac968dbec6c00e8eca5b1d0117.tar.bz2
rails-a79fa9d2233be0ac968dbec6c00e8eca5b1d0117.zip
Destroy rich text dependents
Diffstat (limited to 'lib')
-rw-r--r--lib/action_text/attribute.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/action_text/attribute.rb b/lib/action_text/attribute.rb
index 81bd226646..30cbab70db 100644
--- a/lib/action_text/attribute.rb
+++ b/lib/action_text/attribute.rb
@@ -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}") }