From f528d806df5ebba56800046b16d5cd902e209a76 Mon Sep 17 00:00:00 2001 From: Ryunosuke Sato Date: Sun, 18 Aug 2024 00:57:03 +0900 Subject: [PATCH 1/4] Test on Rails 7.2 --- .github/workflows/tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fa1c4173..bb77d3d4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,6 +16,12 @@ jobs: ruby: ["3.0", "3.1", "3.2"] rails: ["6.1", "7.0", "7.1"] include: + - ruby: "3.1" + rails: "7.2" + - ruby: "3.2" + rails: "7.2" + - ruby: "3.3" + rails: "7.2" - ruby: "3.3" rails: "main" From b95c9b7c9dec7e241f3f1e8cc96350aa43d27bfa Mon Sep 17 00:00:00 2001 From: Ryunosuke Sato Date: Sun, 18 Aug 2024 01:11:01 +0900 Subject: [PATCH 2/4] Use keyword args to define routes due to Rails 8.0's changes --- lib/ember_cli/route_helpers.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ember_cli/route_helpers.rb b/lib/ember_cli/route_helpers.rb index 6fa54d09..c45755fc 100644 --- a/lib/ember_cli/route_helpers.rb +++ b/lib/ember_cli/route_helpers.rb @@ -23,8 +23,8 @@ def mount_ember_app(app_name, to:, **options) }), } - get(to, redirect_if_missing_trailing_slash) - get(File.join(to, "(*rest)"), routing_options) + get(to, **redirect_if_missing_trailing_slash) + get(File.join(to, "(*rest)"), **routing_options) end mount_ember_assets(app_name, to: to) From 3fb53435d1603437185cae7825ed79d1f39ebc1e Mon Sep 17 00:00:00 2001 From: Ryunosuke Sato Date: Sun, 18 Aug 2024 01:11:38 +0900 Subject: [PATCH 3/4] Rewrite mount engine syntax To disable deprecation warning since Rails 8.0. ``` DEPRECATION WARNING: Mounting an engine with a hash key name is deprecated and will be removed in Rails 8.1. Please use the at: option instead. Instead of: mount(SomeRackApp => "some_route") Please use: mount SomeRackApp, at: "some_route" (called from mount_ember_assets at /Users/ryunosuke.sato/src/github.com/thoughtbot/ember-cli-rails/lib/ember_cli/route_helpers.rb:40) ``` --- lib/ember_cli/route_helpers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ember_cli/route_helpers.rb b/lib/ember_cli/route_helpers.rb index c45755fc..3ef5bbd6 100644 --- a/lib/ember_cli/route_helpers.rb +++ b/lib/ember_cli/route_helpers.rb @@ -34,7 +34,7 @@ def mount_ember_assets(app_name, to: "/") app = ::EmberCli[app_name] if app.mountable? - mount app.to_rack => to + mount app.to_rack, at: to end end end From 5c77708f2c6ca5c7e78ed7a62edb20fa749f627d Mon Sep 17 00:00:00 2001 From: Ryunosuke Sato Date: Sun, 18 Aug 2024 01:14:47 +0900 Subject: [PATCH 4/4] Set timezone config explicitly To disable the following warning: ``` DEPRECATION WARNING: `to_time` will always preserve the receiver timezone rather than system local time in Rails 8.0. To opt in to the new behavior, set `config.active_support.to_time_preserves_timezone = :zone`. (called from at /Users/ryunosuke.sato/src/github.com/thoughtbot/ember-cli-rails/spec/spec_helper.rb:9) ``` --- spec/dummy/application.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/dummy/application.rb b/spec/dummy/application.rb index 0b1880ec..fd14a1e3 100644 --- a/spec/dummy/application.rb +++ b/spec/dummy/application.rb @@ -33,6 +33,8 @@ class Application < Rails::Application config.secret_token = "SECRET_TOKEN_IS_MIN_30_CHARS_LONG" config.secret_key_base = "SECRET_KEY_BASE" + config.active_support.to_time_preserves_timezone = :zone + def require_environment! initialize! end