From 530ffa253e5f711eb0fd45b1e33ad293550a8e2d Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 5 Jan 2023 10:03:37 +0000 Subject: [PATCH 1/3] Upgrade to Rails 7 --- Gemfile | 2 +- Gemfile.lock | 161 ++++++++++-------- Gemfile.rails_next.lock | 2 +- config/application.rb | 2 +- .../alaveteli_features.gemspec | 4 +- 5 files changed, 94 insertions(+), 77 deletions(-) diff --git a/Gemfile b/Gemfile index fa2171ac62..9081e8727a 100644 --- a/Gemfile +++ b/Gemfile @@ -81,7 +81,7 @@ source 'https://rubygems.org' # See instructions in Gemfile.rails_next def rails_upgrade? - %w[1 true].include?(ENV['RAILS_UPGRADE']) + true end if rails_upgrade? diff --git a/Gemfile.lock b/Gemfile.lock index 739c5c2561..5e3625f3bc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,11 +17,11 @@ GIT GIT remote: https://github.com/mysociety/strip_attributes.git - revision: 62a5e1ee26501ad4c111b855cd73a5653091300b - branch: globalize3-rails5.2 + revision: 842a889258a897692296dff8445bb9dc12e676f8 + branch: globalize3-rails7 specs: - strip_attributes (1.11.0) - activemodel (>= 3.0, < 7.0) + strip_attributes (1.12.0) + activemodel (>= 3.0, < 8.0) GIT remote: https://github.com/stripe-ruby-mock/stripe-ruby-mock @@ -40,45 +40,52 @@ PATH flipper (~> 0.10) flipper-active_record (~> 0.10) mime-types (< 3.0.0) - rails (~> 6.1.4) + rails (~> 7.0.4) GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7) - actionpack (= 6.1.7) - activesupport (= 6.1.7) + actioncable (7.0.4) + actionpack (= 7.0.4) + activesupport (= 7.0.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7) - actionpack (= 6.1.7) - activejob (= 6.1.7) - activerecord (= 6.1.7) - activestorage (= 6.1.7) - activesupport (= 6.1.7) + actionmailbox (7.0.4) + actionpack (= 7.0.4) + activejob (= 7.0.4) + activerecord (= 7.0.4) + activestorage (= 7.0.4) + activesupport (= 7.0.4) mail (>= 2.7.1) - actionmailer (6.1.7) - actionpack (= 6.1.7) - actionview (= 6.1.7) - activejob (= 6.1.7) - activesupport (= 6.1.7) + net-imap + net-pop + net-smtp + actionmailer (7.0.4) + actionpack (= 7.0.4) + actionview (= 7.0.4) + activejob (= 7.0.4) + activesupport (= 7.0.4) mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp rails-dom-testing (~> 2.0) - actionpack (6.1.7) - actionview (= 6.1.7) - activesupport (= 6.1.7) - rack (~> 2.0, >= 2.0.9) + actionpack (7.0.4) + actionview (= 7.0.4) + activesupport (= 7.0.4) + rack (~> 2.0, >= 2.2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7) - actionpack (= 6.1.7) - activerecord (= 6.1.7) - activestorage (= 6.1.7) - activesupport (= 6.1.7) + actiontext (7.0.4) + actionpack (= 7.0.4) + activerecord (= 7.0.4) + activestorage (= 7.0.4) + activesupport (= 7.0.4) + globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (6.1.7) - activesupport (= 6.1.7) + actionview (7.0.4) + activesupport (= 7.0.4) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -86,27 +93,26 @@ GEM active_model_otp (2.3.1) activemodel rotp (~> 6.2.0) - activejob (6.1.7) - activesupport (= 6.1.7) + activejob (7.0.4) + activesupport (= 7.0.4) globalid (>= 0.3.6) - activemodel (6.1.7) - activesupport (= 6.1.7) - activerecord (6.1.7) - activemodel (= 6.1.7) - activesupport (= 6.1.7) - activestorage (6.1.7) - actionpack (= 6.1.7) - activejob (= 6.1.7) - activerecord (= 6.1.7) - activesupport (= 6.1.7) + activemodel (7.0.4) + activesupport (= 7.0.4) + activerecord (7.0.4) + activemodel (= 7.0.4) + activesupport (= 7.0.4) + activestorage (7.0.4) + actionpack (= 7.0.4) + activejob (= 7.0.4) + activerecord (= 7.0.4) + activesupport (= 7.0.4) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7) + activesupport (7.0.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - zeitwerk (~> 2.3) addressable (2.8.1) public_suffix (>= 2.0.2, < 6.0) annotate (3.2.0) @@ -171,12 +177,13 @@ GEM daemons (1.4.0) dalli (3.2.3) dante (0.2.0) + date (3.3.3) declarative (0.0.20) diff-lcs (1.5.0) digest-crc (0.6.4) rake (>= 12.0.0, < 14.0.0) docile (1.3.5) - erubi (1.11.0) + erubi (1.12.0) eventmachine (1.2.7) exception_notification (4.5.0) actionmailer (>= 5.2, < 8) @@ -196,10 +203,10 @@ GEM fast_gettext (2.2.0) ffi (1.15.5) fivemat (1.3.7) - flipper (0.22.1) - flipper-active_record (0.22.1) - activerecord (>= 4.2, < 7) - flipper (~> 0.22.1) + flipper (0.24.1) + flipper-active_record (0.24.1) + activerecord (>= 4.2, < 8) + flipper (~> 0.24.1) forwardable (1.3.2) gender_detector (2.0.0) gettext (3.4.3) @@ -269,7 +276,7 @@ GEM thor (>= 0.14, < 2.0) jquery-ui-rails (6.0.1) railties (>= 3.2.16) - json (2.6.2) + json (2.6.3) jwt (2.5.0) launchy (2.4.3) addressable (~> 2.3) @@ -299,15 +306,24 @@ GEM mini_portile2 (2.8.1) mini_racer (0.6.3) libv8-node (~> 16.10.0.0) - minitest (5.16.3) + minitest (5.17.0) money (6.16.0) i18n (>= 0.6.4, <= 2) multi_json (1.15.0) multipart-post (2.2.3) + net-imap (0.3.4) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.1) + timeout net-scp (1.2.1) net-ssh (>= 2.6.5) net-sftp (2.1.2) net-ssh (>= 2.6.5) + net-smtp (0.3.3) + net-protocol net-ssh (7.0.1) net-ssh-gateway (2.0.0) net-ssh (>= 4.0.0) @@ -329,7 +345,7 @@ GEM open4 (1.3.4) os (1.1.4) parallel (1.22.1) - parser (3.1.2.1) + parser (3.1.3.0) ast (~> 2.4.1) pg (1.4.4) prime (0.1.2) @@ -340,26 +356,25 @@ GEM method_source (~> 1.0) public_suffix (5.0.0) racc (1.6.2) - rack (2.2.4) + rack (2.2.5) rack-test (2.0.2) rack (>= 1.3) rack-utf8_sanitizer (1.7.0) rack (>= 1.0, < 3.0) - rails (6.1.7) - actioncable (= 6.1.7) - actionmailbox (= 6.1.7) - actionmailer (= 6.1.7) - actionpack (= 6.1.7) - actiontext (= 6.1.7) - actionview (= 6.1.7) - activejob (= 6.1.7) - activemodel (= 6.1.7) - activerecord (= 6.1.7) - activestorage (= 6.1.7) - activesupport (= 6.1.7) + rails (7.0.4) + actioncable (= 7.0.4) + actionmailbox (= 7.0.4) + actionmailer (= 7.0.4) + actionpack (= 7.0.4) + actiontext (= 7.0.4) + actionview (= 7.0.4) + activejob (= 7.0.4) + activemodel (= 7.0.4) + activerecord (= 7.0.4) + activestorage (= 7.0.4) + activesupport (= 7.0.4) bundler (>= 1.15.0) - railties (= 6.1.7) - sprockets-rails (>= 2.0.0) + railties (= 7.0.4) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -372,12 +387,13 @@ GEM rails-i18n (7.0.5) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (6.1.7) - actionpack (= 6.1.7) - activesupport (= 6.1.7) + railties (7.0.4) + actionpack (= 7.0.4) + activesupport (= 7.0.4) method_source rake (>= 12.2) thor (~> 1.0) + zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) rb-fsevent (0.11.0) @@ -430,7 +446,7 @@ GEM rubocop-ast (>= 1.23.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.23.0) + rubocop-ast (1.24.0) parser (>= 3.1.1.0) rubocop-performance (1.15.1) rubocop (>= 1.7.0, < 2.0) @@ -480,6 +496,7 @@ GEM rack (>= 1, < 3) thor (1.2.1) tilt (2.0.10) + timeout (0.3.1) trailblazer-option (0.1.2) tzinfo (2.0.5) concurrent-ruby (~> 1.0) @@ -573,7 +590,7 @@ DEPENDENCIES pry (~> 0.14.1) rack (~> 2.2.4) rack-utf8_sanitizer (~> 1.7.0) - rails (~> 6.1.7) + rails (~> 7.0.4) rails-controller-testing rails-i18n (~> 7.0.5) recaptcha (~> 5.12.3) diff --git a/Gemfile.rails_next.lock b/Gemfile.rails_next.lock index b105705b73..9f5f4467aa 100644 --- a/Gemfile.rails_next.lock +++ b/Gemfile.rails_next.lock @@ -40,7 +40,7 @@ PATH flipper (~> 0.10) flipper-active_record (~> 0.10) mime-types (< 3.0.0) - rails (~> 7.0.2) + rails (~> 7.0.4) GEM remote: https://rubygems.org/ diff --git a/config/application.rb b/config/application.rb index 88995704d2..7fe9fd31b7 100644 --- a/config/application.rb +++ b/config/application.rb @@ -23,7 +23,7 @@ Bundler.require(*Rails.groups) def rails_upgrade? - %w[1 true].include?(ENV['RAILS_UPGRADE']) + true end module Alaveteli diff --git a/gems/alaveteli_features/alaveteli_features.gemspec b/gems/alaveteli_features/alaveteli_features.gemspec index f1e643ced0..9b7dd7ce32 100644 --- a/gems/alaveteli_features/alaveteli_features.gemspec +++ b/gems/alaveteli_features/alaveteli_features.gemspec @@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'alaveteli_features/version' def rails_upgrade? - %w[1 true].include?(ENV['RAILS_UPGRADE']) + true end Gem::Specification.new do |spec| @@ -21,7 +21,7 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_dependency "rails", rails_upgrade? ? "~> 7.0.2" : "~> 6.1.4" + spec.add_dependency "rails", rails_upgrade? ? "~> 7.0.4" : "~> 6.1.4" spec.add_dependency "flipper", "~> 0.10" spec.add_dependency "flipper-active_record", "~> 0.10" # Mime types 3 needs Ruby 2.0.0 or greater, but we need to support 1.9.3 so From 9bf0c864ba32e7c7c258d0d44fb4d992941def6e Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 5 Jan 2023 10:04:24 +0000 Subject: [PATCH 2/3] Remove rails_upgrade conditionals Rails 6.1 is no more so we can drop the old implementation. Leave conditionals methods in Gemfiles for when we prep for Rails edge. --- Gemfile | 12 +- app/views/admin_public_body/show.html.erb | 6 +- config/application.rb | 9 +- .../alaveteli_features.gemspec | 2 +- spec/factories/mail_server_log_dones.rb | 6 +- .../fixtures/files/yaml_compatibility_4_2.yml | 259 ------------------ spec/lib/yaml_compatability_spec.rb | 8 - 7 files changed, 8 insertions(+), 294 deletions(-) delete mode 100644 spec/fixtures/files/yaml_compatibility_4_2.yml diff --git a/Gemfile b/Gemfile index 9081e8727a..c78ea73569 100644 --- a/Gemfile +++ b/Gemfile @@ -84,11 +84,7 @@ def rails_upgrade? true end -if rails_upgrade? - gem 'rails', '~> 7.0.4' -else - gem 'rails', '~> 6.1.7' -end +gem 'rails', '~> 7.0.4' gem 'pg', '~> 1.4.4' @@ -124,11 +120,7 @@ gem 'ruby-msg', '~> 1.5.0', :git => 'https://github.com/mysociety/ruby-msg.git', gem 'rubyzip', '~> 2.3.2' gem 'secure_headers', '~> 6.4.0' gem 'statistics2', '~> 0.54' -if rails_upgrade? - gem 'strip_attributes', :git => 'https://github.com/mysociety/strip_attributes.git', :branch => 'globalize3-rails7' -else - gem 'strip_attributes', :git => 'https://github.com/mysociety/strip_attributes.git', :branch => 'globalize3-rails5.2' -end +gem 'strip_attributes', :git => 'https://github.com/mysociety/strip_attributes.git', :branch => 'globalize3-rails7' gem 'stripe', '~> 5.55.0' gem 'syck', '~> 1.4.1', require: false gem 'syslog_protocol', '~> 0.9.0' diff --git a/app/views/admin_public_body/show.html.erb b/app/views/admin_public_body/show.html.erb index a577a679d9..5f693afd3e 100644 --- a/app/views/admin_public_body/show.html.erb +++ b/app/views/admin_public_body/show.html.erb @@ -78,11 +78,7 @@
- <% if rails_upgrade? %> - <%= version.updated_at.to_fs(:db) %> - <% else %> - <%= version.updated_at.to_s(:db) %> - <% end %> + <%= version.updated_at.to_fs(:db) %> (<%= time_ago_in_words(version.updated_at) %> ago)
diff --git a/config/application.rb b/config/application.rb index 7fe9fd31b7..0495666279 100644 --- a/config/application.rb +++ b/config/application.rb @@ -35,12 +35,9 @@ class Application < Rails::Application # # config.time_zone = "Central Time (US & Canada)" # config.eager_load_paths << Rails.root.join("extras") - - if rails_upgrade? - config.autoloader = :zeitwerk - config.active_record.legacy_connection_handling = false - config.active_support.use_rfc4122_namespaced_uuids = true - end + config.autoloader = :zeitwerk + config.active_record.legacy_connection_handling = false + config.active_support.use_rfc4122_namespaced_uuids = true # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] diff --git a/gems/alaveteli_features/alaveteli_features.gemspec b/gems/alaveteli_features/alaveteli_features.gemspec index 9b7dd7ce32..9b3928b440 100644 --- a/gems/alaveteli_features/alaveteli_features.gemspec +++ b/gems/alaveteli_features/alaveteli_features.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_dependency "rails", rails_upgrade? ? "~> 7.0.4" : "~> 6.1.4" + spec.add_dependency "rails", "~> 7.0.4" spec.add_dependency "flipper", "~> 0.10" spec.add_dependency "flipper-active_record", "~> 0.10" # Mime types 3 needs Ruby 2.0.0 or greater, but we need to support 1.9.3 so diff --git a/spec/factories/mail_server_log_dones.rb b/spec/factories/mail_server_log_dones.rb index 9b3f480982..514aa6635c 100644 --- a/spec/factories/mail_server_log_dones.rb +++ b/spec/factories/mail_server_log_dones.rb @@ -14,11 +14,7 @@ factory :mail_server_log_done do filename { - if rails_upgrade? - "/var/log/mail/mail.log-#{ Date.current.to_fs(:number)} " - else - "/var/log/mail/mail.log-#{ Date.current.to_s(:number)} " - end + "/var/log/mail/mail.log-#{ Date.current.to_fs(:number)} " } last_stat { Time.current } end diff --git a/spec/fixtures/files/yaml_compatibility_4_2.yml b/spec/fixtures/files/yaml_compatibility_4_2.yml deleted file mode 100644 index e19ea582c3..0000000000 --- a/spec/fixtures/files/yaml_compatibility_4_2.yml +++ /dev/null @@ -1,259 +0,0 @@ ---- -:user: !ruby/object:User - raw_attributes: - locale: en - name: Annie All Roles - ban_text: '' - closed_at: - email: annie@localhost - id: '8' - hashed_password: 6b7cd45a5f35fd83febc0452a799530398bfb6e8 - salt: "-6116981980.392287733335677" - created_at: '2007-10-31 10:39:15.491593' - updated_at: '2007-10-31 10:39:15.491593' - email_confirmed: t - url_name: annie_admin - last_daily_track_email: '2000-01-01 00:00:00' - about_me: All the roles - email_bounced_at: - email_bounce_message: '' - no_limit: f - receive_email_alerts: t - can_make_batch_requests: f - otp_enabled: f - otp_secret_key: - otp_counter: '1' - confirmed_not_spam: f - comments_count: '0' - info_requests_count: '1' - track_things_count: '0' - request_classifications_count: '0' - public_body_change_requests_count: '0' - info_request_batches_count: '0' - daily_summary_hour: - daily_summary_minute: - attributes: !ruby/object:ActiveRecord::AttributeSet - attributes: !ruby/object:ActiveRecord::LazyAttributeHash - types: - id: &5 !ruby/object:ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Integer - precision: - scale: - limit: - range: !ruby/range - begin: -2147483648 - end: 2147483648 - excl: true - email: &1 !ruby/object:ActiveRecord::Type::String - precision: - scale: - limit: - name: *1 - hashed_password: *1 - salt: *1 - created_at: &7 !ruby/object:ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter - subtype: &2 !ruby/object:ActiveRecord::ConnectionAdapters::PostgreSQL::OID::DateTime - precision: - scale: - limit: - updated_at: &8 !ruby/object:ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter - subtype: *2 - email_confirmed: &4 !ruby/object:ActiveRecord::Type::Boolean - precision: - scale: - limit: - url_name: &3 !ruby/object:ActiveRecord::Type::Text - precision: - scale: - limit: - last_daily_track_email: &9 !ruby/object:ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter - subtype: *2 - ban_text: *3 - about_me: *3 - locale: *1 - email_bounced_at: &10 !ruby/object:ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter - subtype: *2 - email_bounce_message: *3 - no_limit: *4 - receive_email_alerts: *4 - can_make_batch_requests: *4 - otp_enabled: *4 - otp_secret_key: *1 - otp_counter: *5 - confirmed_not_spam: *4 - comments_count: *5 - info_requests_count: *5 - track_things_count: *5 - request_classifications_count: *5 - public_body_change_requests_count: *5 - info_request_batches_count: *5 - daily_summary_hour: *5 - daily_summary_minute: *5 - closed_at: &6 !ruby/object:ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter - subtype: *2 - values: - id: '8' - email: annie@localhost - name: Annie All Roles - hashed_password: 6b7cd45a5f35fd83febc0452a799530398bfb6e8 - salt: "-6116981980.392287733335677" - created_at: '2007-10-31 10:39:15.491593' - updated_at: '2007-10-31 10:39:15.491593' - email_confirmed: t - url_name: annie_admin - last_daily_track_email: '2000-01-01 00:00:00' - ban_text: '' - about_me: All the roles - locale: en - email_bounced_at: - email_bounce_message: '' - no_limit: f - receive_email_alerts: t - can_make_batch_requests: f - otp_enabled: f - otp_secret_key: - otp_counter: '1' - confirmed_not_spam: f - comments_count: '0' - info_requests_count: '1' - track_things_count: '0' - request_classifications_count: '0' - public_body_change_requests_count: '0' - info_request_batches_count: '0' - daily_summary_hour: - daily_summary_minute: - closed_at: - additional_types: {} - materialized: true - delegate_hash: - locale: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: locale - value_before_type_cast: en - type: *1 - value: en - name: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: name - value_before_type_cast: Annie All Roles - type: *1 - value: Annie All Roles - ban_text: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: ban_text - value_before_type_cast: '' - type: *3 - value: '' - closed_at: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: closed_at - value_before_type_cast: - type: *6 - value: - email: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: email - value_before_type_cast: annie@localhost - type: *1 - value: annie@localhost - id: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: id - value_before_type_cast: '8' - type: *5 - value: 8 - hashed_password: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: hashed_password - value_before_type_cast: 6b7cd45a5f35fd83febc0452a799530398bfb6e8 - type: *1 - salt: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: salt - value_before_type_cast: "-6116981980.392287733335677" - type: *1 - created_at: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: created_at - value_before_type_cast: '2007-10-31 10:39:15.491593' - type: *7 - updated_at: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: updated_at - value_before_type_cast: '2007-10-31 10:39:15.491593' - type: *8 - email_confirmed: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: email_confirmed - value_before_type_cast: t - type: *4 - url_name: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: url_name - value_before_type_cast: annie_admin - type: *3 - last_daily_track_email: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: last_daily_track_email - value_before_type_cast: '2000-01-01 00:00:00' - type: *9 - about_me: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: about_me - value_before_type_cast: All the roles - type: *3 - email_bounced_at: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: email_bounced_at - value_before_type_cast: - type: *10 - email_bounce_message: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: email_bounce_message - value_before_type_cast: '' - type: *3 - no_limit: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: no_limit - value_before_type_cast: f - type: *4 - receive_email_alerts: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: receive_email_alerts - value_before_type_cast: t - type: *4 - can_make_batch_requests: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: can_make_batch_requests - value_before_type_cast: f - type: *4 - otp_enabled: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: otp_enabled - value_before_type_cast: f - type: *4 - otp_secret_key: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: otp_secret_key - value_before_type_cast: - type: *1 - otp_counter: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: otp_counter - value_before_type_cast: '1' - type: *5 - confirmed_not_spam: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: confirmed_not_spam - value_before_type_cast: f - type: *4 - comments_count: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: comments_count - value_before_type_cast: '0' - type: *5 - info_requests_count: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: info_requests_count - value_before_type_cast: '1' - type: *5 - track_things_count: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: track_things_count - value_before_type_cast: '0' - type: *5 - request_classifications_count: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: request_classifications_count - value_before_type_cast: '0' - type: *5 - public_body_change_requests_count: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: public_body_change_requests_count - value_before_type_cast: '0' - type: *5 - info_request_batches_count: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: info_request_batches_count - value_before_type_cast: '0' - type: *5 - daily_summary_hour: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: daily_summary_hour - value_before_type_cast: - type: *5 - daily_summary_minute: !ruby/object:ActiveRecord::Attribute::FromDatabase - name: daily_summary_minute - value_before_type_cast: - type: *5 - new_record: false - active_record_yaml_version: 0 diff --git a/spec/lib/yaml_compatability_spec.rb b/spec/lib/yaml_compatability_spec.rb index 96cd1ea1bc..7274936b99 100644 --- a/spec/lib/yaml_compatability_spec.rb +++ b/spec/lib/yaml_compatability_spec.rb @@ -6,14 +6,6 @@ subject(:output_hash) { described_class.load(content) } let(:hash) { YAML.load(yaml_compatibility_fixture('5_1')) } - context 'with Rails 4.2 YAML file' do - let(:content) { yaml_compatibility_fixture('4_2') } - - it 'correctly loads YAML file' do - is_expected.to eq hash unless rails_upgrade? - end - end - context 'with Rails 5.0 YAML file' do let(:content) { yaml_compatibility_fixture('5_0') } From 6bf3307526711c37207b1ad5aaa11a9305c3bf42 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 5 Jan 2023 10:05:19 +0000 Subject: [PATCH 3/3] Update changelog --- doc/CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 0207f93eab..f54d8fc63e 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -2,6 +2,7 @@ ## Highlighted Features +* Upgrade to Rails 7 (Graeme Porteous) * Add support for Ruby 3 (Graeme Porteous) * Drop support for Ruby 2.7 (Graeme Porteous)