From a8d2f8caa441315d887ed1bb015974c9aa58d339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ana=20Mar=C3=ADa=20Mart=C3=ADnez=20G=C3=B3mez?= Date: Fri, 3 May 2019 17:33:14 +0200 Subject: [PATCH] Drop halt_callback_chains_on_return_false ActiveSupport.halt_callback_chains_on_return_false= is deprecated and will be removed in Rails 5.2. Stop using it and return `throw(:abort)` instead in the callbacks which need it. --- app/models/conference.rb | 1 - app/models/program.rb | 2 -- app/models/role.rb | 2 +- config/initializers/new_framework_defaults.rb | 3 --- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/app/models/conference.rb b/app/models/conference.rb index 89ca5d19..ca37e6d0 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -1120,7 +1120,6 @@ class Conference < ApplicationRecord # def create_email_settings build_email_settings - true end ## diff --git a/app/models/program.rb b/app/models/program.rb index 6c3a3b4a..0dadee15 100644 --- a/app/models/program.rb +++ b/app/models/program.rb @@ -211,7 +211,6 @@ class Program < ApplicationRecord EventType.create(title: 'Workshop', length: 60, color: '#0000FF', description: 'Interactive hands-on practice', minimum_abstract_length: 0, maximum_abstract_length: 500, program_id: id) - true end ## @@ -227,7 +226,6 @@ class Program < ApplicationRecord DifficultyLevel.create(title: 'Hard', description: 'Events require expert knowledge of the topic.', color: '#EF6E69', program_id: id) - true end ## diff --git a/app/models/role.rb b/app/models/role.rb index d759f47d..2be87d7b 100644 --- a/app/models/role.rb +++ b/app/models/role.rb @@ -18,6 +18,6 @@ class Role < ApplicationRecord # Needed to ensure that removing all user from role doesn't remove role. def cancel - false + throw(:abort) end end diff --git a/config/initializers/new_framework_defaults.rb b/config/initializers/new_framework_defaults.rb index cbf423a8..534a2396 100644 --- a/config/initializers/new_framework_defaults.rb +++ b/config/initializers/new_framework_defaults.rb @@ -20,6 +20,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