about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-01-06 16:38:40 +0100
committerGitHub <noreply@github.com>2019-01-06 16:38:40 +0100
commit86f27b178c778f6e8ea8e3de938741cd62a20cfa (patch)
tree03bf0b91067f9f0ad2b6689b0ad3f22cc0b1fc64
parent1cbdf8d218dcd07889d14e4f5f22a4339bddb879 (diff)
Fix deleting a scheduled status immediately deleting media attachments (#9728)
-rw-r--r--app/models/scheduled_status.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/scheduled_status.rb b/app/models/scheduled_status.rb
index c95470fc8..27f0cbd28 100644
--- a/app/models/scheduled_status.rb
+++ b/app/models/scheduled_status.rb
@@ -17,7 +17,7 @@ class ScheduledStatus < ApplicationRecord
   DAILY_LIMIT = 25
 
   belongs_to :account, inverse_of: :scheduled_statuses
-  has_many :media_attachments, inverse_of: :scheduled_status, dependent: :destroy
+  has_many :media_attachments, inverse_of: :scheduled_status, dependent: :nullify
 
   validate :validate_future_date
   validate :validate_total_limit