Fix deprecation: returning false in Active Record and Active Model callbacks will not implicitly halt a callback chain
This commit is contained in:
parent
5a9808651b
commit
d36b022fae
3 changed files with 7 additions and 4 deletions
|
@ -54,6 +54,6 @@ class List < ActiveRecord::Base
|
|||
private
|
||||
|
||||
def can_be_destroyed
|
||||
destroyable?
|
||||
throw(:abort) unless destroyable?
|
||||
end
|
||||
end
|
||||
|
|
6
changelogs/unreleased/deprecated-callback-false.yml
Normal file
6
changelogs/unreleased/deprecated-callback-false.yml
Normal file
|
@ -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
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue