summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/list.rb2
-rw-r--r--changelogs/unreleased/deprecated-callback-false.yml6
-rw-r--r--config/initializers/new_framework_defaults.rb3
3 files changed, 7 insertions, 4 deletions
diff --git a/app/models/list.rb b/app/models/list.rb
index 029685be927..682af761ba0 100644
--- a/app/models/list.rb
+++ b/app/models/list.rb
@@ -54,6 +54,6 @@ class List < ActiveRecord::Base
private
def can_be_destroyed
- destroyable?
+ throw(:abort) unless destroyable?
end
end
diff --git a/changelogs/unreleased/deprecated-callback-false.yml b/changelogs/unreleased/deprecated-callback-false.yml
new file mode 100644
index 00000000000..6ba01a75ab9
--- /dev/null
+++ b/changelogs/unreleased/deprecated-callback-false.yml
@@ -0,0 +1,6 @@
+---
+title: 'Fix deprecation: returning false in Active Record and Active Model callbacks
+ will not implicitly halt a callback chain'
+merge_request: 24134
+author: Jasper Maes
+type: other
diff --git a/config/initializers/new_framework_defaults.rb b/config/initializers/new_framework_defaults.rb
index 5adb9f7a4b4..a1e0667bc6f 100644
--- a/config/initializers/new_framework_defaults.rb
+++ b/config/initializers/new_framework_defaults.rb
@@ -22,6 +22,3 @@ ActiveSupport.to_time_preserves_timezone = false
# Require `belongs_to` associations by default. Previous versions had false.
Rails.application.config.active_record.belongs_to_required_by_default = false
-
-# Do not halt callback chains when a callback returns false. Previous versions had true.
-ActiveSupport.halt_callback_chains_on_return_false = true