Skip to content

Commit 34d0cf0

Browse files
authored
feat: Support rails 8.1 (#500)
* Rails 8.1 removed ActionDispatch::Journey::Router::Utils.uri_decoder method and now the default way to decode the url is to use URI.decode_uri_component * add rails 8.1 tests
1 parent 67be212 commit 34d0cf0

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
- gemfiles/rails_7_1_graphiti_rails.gemfile
4646
- gemfiles/rails_7_2_graphiti_rails.gemfile
4747
- gemfiles/rails_8_0_graphiti_rails.gemfile
48+
- gemfiles/rails_8_1_graphiti_rails.gemfile
4849
appraisal:
4950
- true
5051
- false
@@ -58,6 +59,9 @@ jobs:
5859
- ruby: ruby-head
5960
gemfile: gemfiles/rails_8_0_graphiti_rails.gemfile
6061
appraisal: true
62+
- ruby: ruby-head
63+
gemfile: gemfiles/rails_8_1_graphiti_rails.gemfile
64+
appraisal: true
6165
- ruby: ruby-head
6266
gemfile: Gemfile
6367
appraisal: false
@@ -83,6 +87,16 @@ jobs:
8387
appraisal: false
8488
- gemfile: gemfiles/rails_8_0_graphiti_rails.gemfile
8589
appraisal: false
90+
- gemfile: gemfiles/rails_8_1_graphiti_rails.gemfile
91+
appraisal: false
92+
93+
# Rails 8.1 needs ruby 3.2 +
94+
- gemfile: gemfiles/rails_8_1_graphiti_rails.gemfile
95+
ruby: 2.7
96+
- gemfile: gemfiles/rails_8_1_graphiti_rails.gemfile
97+
ruby: 3.0
98+
- gemfile: gemfiles/rails_8_1_graphiti_rails.gemfile
99+
ruby: 3.1
86100

87101
# Rails 8 needs ruby 3.2 +
88102
- gemfile: gemfiles/rails_8_0_graphiti_rails.gemfile
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rails", "~> 8.1"
6+
gem "rspec-rails"
7+
gem "sqlite3", "~> 2.1"
8+
gem "database_cleaner"
9+
gem "graphiti-rails", "~> 0.4.0"
10+
11+
group :test do
12+
gem "pry"
13+
gem "pry-byebug", platform: [:mri]
14+
gem "appraisal"
15+
gem "guard"
16+
gem "guard-rspec"
17+
end
18+
19+
gemspec path: "../"

lib/graphiti/configuration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def uri_decoder=(decoder)
115115
private
116116

117117
def infer_uri_decoder
118-
if defined?(::ActionDispatch::Journey::Router::Utils)
118+
if defined?(::ActionDispatch::Journey::Router::Utils) && ::ActionDispatch::Journey::Router::Utils.respond_to?(:unescape_uri)
119119
# available in all supported versions of Rails.
120120
# This method should be preferred for comparing URI path segments
121121
# to params, as it is the exact decoder used in the Rails router.

0 commit comments

Comments
 (0)