From b16dbe9db8e48ef82d1f66a795f09653122e567b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guitaut?= Date: Thu, 30 May 2024 11:11:40 +0200 Subject: [PATCH] DEV: Add compatibility with Rails 7.2 --- .github/workflows/ci.yml | 10 +++++++--- CHANGELOG.md | 6 ++++++ gemfiles/rails_7.2.gemfile | 12 ++++++++++++ lib/rails_multisite/connection_management.rb | 5 +++-- lib/rails_multisite/version.rb | 2 +- 5 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 gemfiles/rails_7.2.gemfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 248d656..a8813c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,9 +16,13 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["3.1", "3.2", "3.3"] - rails: ["6.1", "7.0", "7.1", "edge"] - ok_to_fail: [""] + ruby: ["3.1", "3.2", "3.3", "3.4"] + rails: ["6.1", "7.0", "7.1", "7.2", "edge"] + exclude: + - ruby: "3.4" + rails: "6.1" + - ruby: "3.4" + rails: "7.0" steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cd31ee..eb3f273 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [6.1.0] - 2024-08-13 + +### Added + +- Support for Rails 7.2+ + ## [6.0.0] - 2024-03-14 ### Added diff --git a/gemfiles/rails_7.2.gemfile b/gemfiles/rails_7.2.gemfile new file mode 100644 index 0000000..2f6a6da --- /dev/null +++ b/gemfiles/rails_7.2.gemfile @@ -0,0 +1,12 @@ +# frozen_string_literal: true +source 'https://rubygems.org' + +group :test do + gem 'activerecord', '~> 7.2.0' + gem 'railties', '~> 7.2.0' + gem 'rspec' + gem 'sqlite3', '~> 1.4' + gem 'byebug' + gem 'rubocop' + gem 'rubocop-discourse' +end diff --git a/lib/rails_multisite/connection_management.rb b/lib/rails_multisite/connection_management.rb index 324b815..b661e88 100644 --- a/lib/rails_multisite/connection_management.rb +++ b/lib/rails_multisite/connection_management.rb @@ -297,9 +297,10 @@ def host(env) request = Rack::Request.new(env) host = - if request["__ws"] && self.class.asset_hostnames&.include?(request.host) + if request.params["__ws"] && + self.class.asset_hostnames&.include?(request.host) request.cookies.clear - request["__ws"] + request.params["__ws"] else request.host end diff --git a/lib/rails_multisite/version.rb b/lib/rails_multisite/version.rb index 6c67055..d84b768 100644 --- a/lib/rails_multisite/version.rb +++ b/lib/rails_multisite/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true # module RailsMultisite - VERSION = "6.0.0" + VERSION = "6.1.0" end