diff options
author | Robert Speicher <rspeicher@gmail.com> | 2019-01-04 18:31:56 +0000 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2019-01-04 18:31:56 +0000 |
commit | c87770be0b50ee6f6b780ed5ecb2b098ed0aa8b9 (patch) | |
tree | 49576eff61bd4554bfd0c59faefc82f3744aae4a | |
parent | 2ab68a2341ba0925e434dd0270ef2b0e9934be4e (diff) | |
parent | d36b022fae66fc0841335b73b6c7e1a4ecbcaa6e (diff) | |
download | gitlab-ce-c87770be0b50ee6f6b780ed5ecb2b098ed0aa8b9.tar.gz |
Merge branch 'deprecated-callback-false' into 'master'
Fix deprecation: returning false in Active Record and Active Model callbacks
See merge request gitlab-org/gitlab-ce!24134
-rw-r--r-- | app/models/list.rb | 2 | ||||
-rw-r--r-- | changelogs/unreleased/deprecated-callback-false.yml | 6 | ||||
-rw-r--r-- | config/initializers/new_framework_defaults.rb | 3 |
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 |