From d2bdec3d37928da811ec61e0bc7e6e2a1199e528 Mon Sep 17 00:00:00 2001 From: rebuilt Date: Fri, 24 Sep 2021 11:05:48 +0200 Subject: [PATCH] Upgrade to rails 5.1.7, coffee-rails 4.2. Remove phantomjs/poltergeist. Remove deprecated call to halt_callback_chains_on_return_false method. Change attribute_was calls to attribute_before_last_save --- Gemfile | 8 +- Gemfile.lock | 316 +++++++++--------- app/models/recipient_list.rb | 4 +- config/initializers/new_framework_defaults.rb | 3 - 4 files changed, 160 insertions(+), 171 deletions(-) diff --git a/Gemfile b/Gemfile index a0547fb3..6fde29b3 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,7 @@ end # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '~> 5.0.1' +gem 'rails', '~> 5.1.7' gem 'pg' @@ -19,7 +19,7 @@ gem 'sass-rails', '>= 5.0.6' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' # Use CoffeeScript for .coffee assets and views -gem 'coffee-rails', '~> 4.2' +# gem 'coffee-rails', '~> 5.0' # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'therubyracer', platforms: :ruby @@ -72,11 +72,9 @@ group :development do end group 'test' do - gem 'rspec-rails', '~> 3.5' + gem 'rspec-rails', '~> 4.1.2' gem 'rails-controller-testing' gem 'capybara' - gem 'phantomjs', require: 'phantomjs/poltergeist' - gem 'poltergeist' gem 'launchy' gem 'database_cleaner' gem 'timecop' diff --git a/Gemfile.lock b/Gemfile.lock index 70081521..8bda44ea 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,256 +1,253 @@ GEM remote: https://rubygems.org/ specs: - actioncable (5.0.7) - actionpack (= 5.0.7) - nio4r (>= 1.2, < 3.0) + actioncable (5.1.7) + actionpack (= 5.1.7) + nio4r (~> 2.0) websocket-driver (~> 0.6.1) - actionmailer (5.0.7) - actionpack (= 5.0.7) - actionview (= 5.0.7) - activejob (= 5.0.7) + actionmailer (5.1.7) + actionpack (= 5.1.7) + actionview (= 5.1.7) + activejob (= 5.1.7) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.0.7) - actionview (= 5.0.7) - activesupport (= 5.0.7) + actionpack (5.1.7) + actionview (= 5.1.7) + activesupport (= 5.1.7) rack (~> 2.0) - rack-test (~> 0.6.3) + rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.0.7) - activesupport (= 5.0.7) + actionview (5.1.7) + activesupport (= 5.1.7) builder (~> 3.1) - erubis (~> 2.7.0) + erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.0.7) - activesupport (= 5.0.7) + activejob (5.1.7) + activesupport (= 5.1.7) globalid (>= 0.3.6) - activemodel (5.0.7) - activesupport (= 5.0.7) - activerecord (5.0.7) - activemodel (= 5.0.7) - activesupport (= 5.0.7) - arel (~> 7.0) - activerecord-import (0.27.0) + activemodel (5.1.7) + activesupport (= 5.1.7) + activerecord (5.1.7) + activemodel (= 5.1.7) + activesupport (= 5.1.7) + arel (~> 8.0) + activerecord-import (1.2.0) activerecord (>= 3.2) - activesupport (5.0.7) + activesupport (5.1.7) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) - arel (7.1.4) - autoprefixer-rails (8.6.5) - execjs - bcrypt (3.1.12) - bindex (0.5.0) + addressable (2.8.0) + public_suffix (>= 2.0.2, < 5.0) + arel (8.0.0) + autoprefixer-rails (10.3.3.0) + execjs (~> 2) + bcrypt (3.1.16) + bindex (0.8.1) bootstrap (4.0.0) autoprefixer-rails (>= 6.0.3) popper_js (>= 1.12.9, < 2) sass (>= 3.5.2) - builder (3.2.3) - byebug (10.0.2) - capybara (3.3.1) + builder (3.2.4) + byebug (11.1.3) + capybara (3.35.3) addressable mini_mime (>= 0.1.3) nokogiri (~> 1.8) rack (>= 1.6.0) rack-test (>= 0.6.3) - xpath (~> 3.1) - cliver (0.3.2) - coffee-rails (4.2.2) - coffee-script (>= 2.2.0) - railties (>= 4.0.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.12.2) - concurrent-ruby (1.0.5) - crass (1.0.4) - database_cleaner (1.7.0) - devise (4.4.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + concurrent-ruby (1.1.9) + crass (1.0.6) + database_cleaner (2.0.1) + database_cleaner-active_record (~> 2.0.0) + database_cleaner-active_record (2.0.1) + activerecord (>= 5.a) + database_cleaner-core (~> 2.0.0) + database_cleaner-core (2.0.1) + devise (4.8.0) bcrypt (~> 3.0) orm_adapter (~> 0.1) - railties (>= 4.1.0, < 6.0) + railties (>= 4.1.0) responders warden (~> 1.2.3) - diff-lcs (1.3) - erubis (2.7.0) - execjs (2.7.0) - ffi (1.9.25) + diff-lcs (1.4.4) + erubi (1.10.0) + execjs (2.8.1) + ffi (1.15.4) friendly_id (5.1.0) activerecord (>= 4.0.0) - globalid (0.4.1) - activesupport (>= 4.2.0) - haml (5.0.4) + globalid (0.5.2) + activesupport (>= 5.0) + haml (5.2.2) temple (>= 0.8.0) tilt - hashie (3.5.7) - i18n (1.0.1) + hashie (4.1.0) + i18n (1.8.10) concurrent-ruby (~> 1.0) - jbuilder (2.7.0) - activesupport (>= 4.2.0) - multi_json (>= 1.2) - jquery-rails (4.3.3) + jbuilder (2.11.2) + activesupport (>= 5.0.0) + jquery-rails (4.4.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) jquery-ui-rails (6.0.1) railties (>= 3.2.16) jwt (1.5.6) - launchy (2.4.3) - addressable (~> 2.3) - libv8 (3.16.14.19) + launchy (2.5.0) + addressable (~> 2.7) libv8 (3.16.14.19-x86_64-linux) listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - loofah (2.2.2) + loofah (2.12.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.7.0) + mail (2.7.1) mini_mime (>= 0.1.1) - method_source (0.9.0) - mini_mime (1.0.0) - mini_portile2 (2.3.0) - minitest (5.11.3) - multi_json (1.13.1) - nested_scaffold (1.0.0) - newrelic_rpm (5.2.0.345) - nio4r (2.3.1) - nokogiri (1.8.4) - mini_portile2 (~> 2.3.0) - omniauth (1.8.1) - hashie (>= 3.4.6, < 3.6.0) + method_source (1.0.0) + mini_mime (1.1.1) + minitest (5.14.4) + multi_json (1.15.0) + nested_scaffold (1.1.0) + newrelic_rpm (8.0.0) + nio4r (2.5.8) + nokogiri (1.12.4-x86_64-linux) + racc (~> 1.4) + omniauth (2.0.4) + hashie (>= 3.4.6) rack (>= 1.6.2, < 3) + rack-protection orm_adapter (0.5.0) - pg (1.0.0) - phantomjs (2.1.1.0) - poltergeist (1.18.1) - capybara (>= 2.1, < 4) - cliver (~> 0.3.1) - websocket-driver (>= 0.2.0) - popper_js (1.12.9) - public_suffix (3.0.2) - puma (3.11.4) - rack (2.0.5) - rack-test (0.6.3) - rack (>= 1.0) - rails (5.0.7) - actioncable (= 5.0.7) - actionmailer (= 5.0.7) - actionpack (= 5.0.7) - actionview (= 5.0.7) - activejob (= 5.0.7) - activemodel (= 5.0.7) - activerecord (= 5.0.7) - activesupport (= 5.0.7) + pg (1.2.3) + popper_js (1.16.0) + public_suffix (4.0.6) + puma (3.12.6) + racc (1.5.2) + rack (2.2.3) + rack-protection (2.1.0) + rack + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (5.1.7) + actioncable (= 5.1.7) + actionmailer (= 5.1.7) + actionpack (= 5.1.7) + actionview (= 5.1.7) + activejob (= 5.1.7) + activemodel (= 5.1.7) + activerecord (= 5.1.7) + activesupport (= 5.1.7) bundler (>= 1.3.0) - railties (= 5.0.7) + railties (= 5.1.7) sprockets-rails (>= 2.0.0) - rails-controller-testing (1.0.2) - actionpack (~> 5.x, >= 5.0.1) - actionview (~> 5.x, >= 5.0.1) - activesupport (~> 5.x) + rails-controller-testing (1.0.5) + actionpack (>= 5.0.1.rc1) + actionview (>= 5.0.1.rc1) + activesupport (>= 5.0.1.rc1) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.0.4) - loofah (~> 2.2, >= 2.2.2) - railties (5.0.7) - actionpack (= 5.0.7) - activesupport (= 5.0.7) + rails-html-sanitizer (1.4.2) + loofah (~> 2.3) + railties (5.1.7) + actionpack (= 5.1.7) + activesupport (= 5.1.7) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rake (13.0.1) - rb-fsevent (0.10.3) - rb-inotify (0.9.10) - ffi (>= 0.5.0, < 2) + rake (13.0.6) + rb-fsevent (0.11.0) + rb-inotify (0.10.1) + ffi (~> 1.0) ref (2.0.0) - responders (2.4.0) - actionpack (>= 4.2.0, < 5.3) - railties (>= 4.2.0, < 5.3) - rspec-core (3.7.1) - rspec-support (~> 3.7.0) - rspec-expectations (3.7.0) + regexp_parser (2.1.1) + responders (3.0.1) + actionpack (>= 5.0) + railties (>= 5.0) + rspec-core (3.10.1) + rspec-support (~> 3.10.0) + rspec-expectations (3.10.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.7.0) - rspec-mocks (3.7.0) + rspec-support (~> 3.10.0) + rspec-mocks (3.10.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.7.0) - rspec-rails (3.7.2) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 3.7.0) - rspec-expectations (~> 3.7.0) - rspec-mocks (~> 3.7.0) - rspec-support (~> 3.7.0) - rspec-support (3.7.1) - sass (3.5.6) + rspec-support (~> 3.10.0) + rspec-rails (4.1.2) + actionpack (>= 4.2) + activesupport (>= 4.2) + railties (>= 4.2) + rspec-core (~> 3.10) + rspec-expectations (~> 3.10) + rspec-mocks (~> 3.10) + rspec-support (~> 3.10) + rspec-support (3.10.2) + sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - sass-rails (5.0.7) - railties (>= 4.0.0, < 6) - sass (~> 3.1) - sprockets (>= 2.8, < 4.0) - sprockets-rails (>= 2.0, < 4.0) - tilt (>= 1.1, < 3) + sass-rails (6.0.0) + sassc-rails (~> 2.1, >= 2.1.1) + sassc (2.4.0) + ffi (~> 1.9) + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt seed_dump (3.3.1) activerecord (>= 4) activesupport (>= 4) - spring (2.0.2) - activesupport (>= 4.2) + spring (2.1.1) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) - sprockets (3.7.2) + sprockets (4.0.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.1) + sprockets-rails (3.2.2) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - temple (0.8.0) + temple (0.8.2) therubyracer (0.12.3) libv8 (~> 3.16.14.15) ref - thor (0.20.0) + thor (1.1.0) thread_safe (0.3.6) - tilt (2.0.8) - timecop (0.9.1) - turbolinks (5.1.1) - turbolinks-source (~> 5.1) - turbolinks-source (5.1.0) + tilt (2.0.10) + timecop (0.9.4) + turbolinks (5.2.1) + turbolinks-source (~> 5.2) + turbolinks-source (5.2.0) twilio-ruby (4.11.1) builder (>= 2.1.2) jwt (~> 1.0) multi_json (>= 1.3.0) tzinfo (1.2.9) thread_safe (~> 0.1) - uglifier (4.1.14) + uglifier (4.2.0) execjs (>= 0.3.0, < 3) - warden (1.2.7) - rack (>= 1.0) - web-console (3.6.2) + warden (1.2.9) + rack (>= 2.0.9) + web-console (3.7.0) actionview (>= 5.0) activemodel (>= 5.0) bindex (>= 0.4.0) railties (>= 5.0) websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.3) - xpath (3.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) nokogiri (~> 1.8) PLATFORMS - x86_64-darwin-20 x86_64-linux DEPENDENCIES @@ -258,7 +255,6 @@ DEPENDENCIES bootstrap (~> 4.0.0.alpha6) byebug capybara - coffee-rails (~> 4.2) database_cleaner devise friendly_id (~> 5.1.0) @@ -272,12 +268,10 @@ DEPENDENCIES newrelic_rpm omniauth pg - phantomjs - poltergeist puma (~> 3.0) - rails (~> 5.0.1) + rails (~> 5.1.7) rails-controller-testing - rspec-rails (~> 3.5) + rspec-rails (~> 4.1.2) sass-rails (>= 5.0.6) seed_dump spring diff --git a/app/models/recipient_list.rb b/app/models/recipient_list.rb index dc4a046d..f51970fb 100644 --- a/app/models/recipient_list.rb +++ b/app/models/recipient_list.rb @@ -28,8 +28,8 @@ class RecipientList < ApplicationRecord end def sync_recipient_schedules - return unless recipient_ids_was.present? && recipient_ids_was != recipient_ids - old_ids = recipient_ids_was.split(/,/) + return unless recipient_ids_before_last_save.present? && recipient_ids_before_last_save != recipient_ids + old_ids = recipient_ids_before_last_save.split(/,/) new_ids = recipient_ids.split(/,/) (old_ids - new_ids).each do |deleted_recipient| schedules.each do |schedule| diff --git a/config/initializers/new_framework_defaults.rb b/config/initializers/new_framework_defaults.rb index 671abb69..dec6272f 100644 --- a/config/initializers/new_framework_defaults.rb +++ b/config/initializers/new_framework_defaults.rb @@ -17,8 +17,5 @@ ActiveSupport.to_time_preserves_timezone = true # Require `belongs_to` associations by default. Previous versions had false. Rails.application.config.active_record.belongs_to_required_by_default = true -# Do not halt callback chains when a callback returns false. Previous versions had true. -ActiveSupport.halt_callback_chains_on_return_false = false - # Configure SSL options to enable HSTS with subdomains. Previous versions had false. Rails.application.config.ssl_options = { hsts: { subdomains: true } }