Skip to content

Commit 1d5a84d

Browse files
Merge pull request #2064 from dmitry-sinina/rails_8_1
Upgrade to Rails 8.1
1 parent a14b65e commit 1d5a84d

4 files changed

Lines changed: 77 additions & 79 deletions

File tree

Gemfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ gem 'pg'
1010
gem 'pg_advisory_lock', git: 'https://github.com/didww/pg_advisory_lock.git'
1111
gem 'pg_sql_caller', git: 'https://github.com/didww/pg_sql_caller.git'
1212
gem 'rack'
13-
gem 'rails', '~> 8.0.0'
13+
gem 'rails', '~> 8.1.0'
1414
gem 'responders'
1515

1616
# Authentication
@@ -44,10 +44,9 @@ gem 'active_admin_sidebar', '~> 3.0'
4444
gem 'excelinator', github: 'senid231/excelinator', branch: 'ruby3-fix'
4545

4646
# REST API
47-
# TODO: switch to the official gem from rubygems.org after the 0.9.13 release
48-
# https://github.com/cerebris/jsonapi-resources/issues/1456#issuecomment-2710742154
49-
# https://github.com/cerebris/jsonapi-resources/pull/1463
50-
gem 'jsonapi-resources', github: 'JSONAPI-Resources/jsonapi-resources', branch: 'release-0-9'
47+
# Fork of release-0-9 with Rails 8.1 support: upstream passes route options positionally,
48+
# which the 8.1 route mapper rejects, and still calls the removed ActiveSupport::Deprecation.warn.
49+
gem 'jsonapi-resources', github: 'yeti-switch/jsonapi-resources', branch: 'release-0-9-rails-8-1'
5150

5251
# gem 'activeadmin_async_export'
5352

Gemfile.lock

Lines changed: 69 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
GIT
2-
remote: https://github.com/JSONAPI-Resources/jsonapi-resources.git
3-
revision: 17772cefd8a90fc1b54744871de1050a6040a691
4-
branch: release-0-9
5-
specs:
6-
jsonapi-resources (0.9.12)
7-
activerecord (>= 4.1)
8-
concurrent-ruby
9-
railties (>= 4.1)
10-
111
GIT
122
remote: https://github.com/activeadmin-plugins/active_admin_date_range_preset.git
133
revision: dfcf8f65c2173b631169f371cc436c58a0c29287
@@ -91,48 +81,62 @@ GIT
9181
active_admin_theme (2.0.0)
9282
activeadmin (>= 3.0, < 4.0)
9383

84+
GIT
85+
remote: https://github.com/yeti-switch/jsonapi-resources.git
86+
revision: 070cb888aa4ca21f7bdf881f4d567856e02168bb
87+
branch: release-0-9-rails-8-1
88+
specs:
89+
jsonapi-resources (0.9.12)
90+
activerecord (>= 4.1)
91+
concurrent-ruby
92+
csv
93+
railties (>= 4.1)
94+
9495
GEM
9596
remote: https://rubygems.org/
9697
specs:
97-
actioncable (8.0.5)
98-
actionpack (= 8.0.5)
99-
activesupport (= 8.0.5)
98+
action_text-trix (2.1.19)
99+
railties
100+
actioncable (8.1.3)
101+
actionpack (= 8.1.3)
102+
activesupport (= 8.1.3)
100103
nio4r (~> 2.0)
101104
websocket-driver (>= 0.6.1)
102105
zeitwerk (~> 2.6)
103-
actionmailbox (8.0.5)
104-
actionpack (= 8.0.5)
105-
activejob (= 8.0.5)
106-
activerecord (= 8.0.5)
107-
activestorage (= 8.0.5)
108-
activesupport (= 8.0.5)
106+
actionmailbox (8.1.3)
107+
actionpack (= 8.1.3)
108+
activejob (= 8.1.3)
109+
activerecord (= 8.1.3)
110+
activestorage (= 8.1.3)
111+
activesupport (= 8.1.3)
109112
mail (>= 2.8.0)
110-
actionmailer (8.0.5)
111-
actionpack (= 8.0.5)
112-
actionview (= 8.0.5)
113-
activejob (= 8.0.5)
114-
activesupport (= 8.0.5)
113+
actionmailer (8.1.3)
114+
actionpack (= 8.1.3)
115+
actionview (= 8.1.3)
116+
activejob (= 8.1.3)
117+
activesupport (= 8.1.3)
115118
mail (>= 2.8.0)
116119
rails-dom-testing (~> 2.2)
117-
actionpack (8.0.5)
118-
actionview (= 8.0.5)
119-
activesupport (= 8.0.5)
120+
actionpack (8.1.3)
121+
actionview (= 8.1.3)
122+
activesupport (= 8.1.3)
120123
nokogiri (>= 1.8.5)
121124
rack (>= 2.2.4)
122125
rack-session (>= 1.0.1)
123126
rack-test (>= 0.6.3)
124127
rails-dom-testing (~> 2.2)
125128
rails-html-sanitizer (~> 1.6)
126129
useragent (~> 0.16)
127-
actiontext (8.0.5)
128-
actionpack (= 8.0.5)
129-
activerecord (= 8.0.5)
130-
activestorage (= 8.0.5)
131-
activesupport (= 8.0.5)
130+
actiontext (8.1.3)
131+
action_text-trix (~> 2.1.15)
132+
actionpack (= 8.1.3)
133+
activerecord (= 8.1.3)
134+
activestorage (= 8.1.3)
135+
activesupport (= 8.1.3)
132136
globalid (>= 0.6.0)
133137
nokogiri (>= 1.8.5)
134-
actionview (8.0.5)
135-
activesupport (= 8.0.5)
138+
actionview (8.1.3)
139+
activesupport (= 8.1.3)
136140
builder (~> 3.1)
137141
erubi (~> 1.11)
138142
rails-dom-testing (~> 2.2)
@@ -161,35 +165,35 @@ GEM
161165
kaminari (>= 1.2.1)
162166
railties (>= 6.1)
163167
ransack (>= 4.0)
164-
activejob (8.0.5)
165-
activesupport (= 8.0.5)
168+
activejob (8.1.3)
169+
activesupport (= 8.1.3)
166170
globalid (>= 0.3.6)
167-
activemodel (8.0.5)
168-
activesupport (= 8.0.5)
171+
activemodel (8.1.3)
172+
activesupport (= 8.1.3)
169173
activemodel-serializers-xml (1.0.3)
170174
activemodel (>= 5.0.0.a)
171175
activesupport (>= 5.0.0.a)
172176
builder (~> 3.1)
173-
activerecord (8.0.5)
174-
activemodel (= 8.0.5)
175-
activesupport (= 8.0.5)
177+
activerecord (8.1.3)
178+
activemodel (= 8.1.3)
179+
activesupport (= 8.1.3)
176180
timeout (>= 0.4.0)
177181
activerecord-import (2.2.0)
178182
activerecord (>= 4.2)
179-
activestorage (8.0.5)
180-
actionpack (= 8.0.5)
181-
activejob (= 8.0.5)
182-
activerecord (= 8.0.5)
183-
activesupport (= 8.0.5)
183+
activestorage (8.1.3)
184+
actionpack (= 8.1.3)
185+
activejob (= 8.1.3)
186+
activerecord (= 8.1.3)
187+
activesupport (= 8.1.3)
184188
marcel (~> 1.0)
185-
activesupport (8.0.5)
189+
activesupport (8.1.3)
186190
base64
187-
benchmark (>= 0.3)
188191
bigdecimal
189192
concurrent-ruby (~> 1.0, >= 1.3.1)
190193
connection_pool (>= 2.2.5)
191194
drb
192195
i18n (>= 1.6, < 2)
196+
json
193197
logger (>= 1.4.2)
194198
minitest (>= 5.1)
195199
securerandom (>= 0.3)
@@ -818,20 +822,20 @@ GEM
818822
rack (>= 1.3)
819823
rackup (2.3.1)
820824
rack (>= 3)
821-
rails (8.0.5)
822-
actioncable (= 8.0.5)
823-
actionmailbox (= 8.0.5)
824-
actionmailer (= 8.0.5)
825-
actionpack (= 8.0.5)
826-
actiontext (= 8.0.5)
827-
actionview (= 8.0.5)
828-
activejob (= 8.0.5)
829-
activemodel (= 8.0.5)
830-
activerecord (= 8.0.5)
831-
activestorage (= 8.0.5)
832-
activesupport (= 8.0.5)
825+
rails (8.1.3)
826+
actioncable (= 8.1.3)
827+
actionmailbox (= 8.1.3)
828+
actionmailer (= 8.1.3)
829+
actionpack (= 8.1.3)
830+
actiontext (= 8.1.3)
831+
actionview (= 8.1.3)
832+
activejob (= 8.1.3)
833+
activemodel (= 8.1.3)
834+
activerecord (= 8.1.3)
835+
activestorage (= 8.1.3)
836+
activesupport (= 8.1.3)
833837
bundler (>= 1.15.0)
834-
railties (= 8.0.5)
838+
railties (= 8.1.3)
835839
rails-dom-testing (2.3.0)
836840
activesupport (>= 5.0.0)
837841
minitest
@@ -843,9 +847,9 @@ GEM
843847
rack
844848
railties (>= 5.1)
845849
semantic_logger (~> 4.16)
846-
railties (8.0.5)
847-
actionpack (= 8.0.5)
848-
activesupport (= 8.0.5)
850+
railties (8.1.3)
851+
actionpack (= 8.1.3)
852+
activesupport (= 8.1.3)
849853
irb (~> 1.13)
850854
rackup (>= 1.0.0)
851855
rake (>= 12.2)
@@ -1125,7 +1129,7 @@ DEPENDENCIES
11251129
puma_worker_killer
11261130
pundit
11271131
rack
1128-
rails (~> 8.0.0)
1132+
rails (~> 8.1.0)
11291133
rails-html-sanitizer (>= 1.6.1)
11301134
rails_semantic_logger
11311135
ransack

config/application.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,11 @@
3030
module Yeti
3131
class Application < Rails::Application
3232
# Initialize configuration defaults for originally generated Rails version.
33-
config.load_defaults 7.2
33+
config.load_defaults 8.1
3434

3535
# changing defaults
3636
config.action_view.default_enforce_utf8 = true
3737

38-
# Rails 8.0 deprecates the :offset behavior of to_time; opt into the :zone behavior
39-
# (the Rails 8.1 default). Our timezone logic uses TimeWithZone, not to_time offset
40-
# semantics, so this is safe (verified by the invoice period specs).
41-
config.active_support.to_time_preserves_timezone = :zone
42-
4338
# Settings in config/environments/* take precedence over those specified here.
4439
# Application configuration can go into files in config/initializers
4540
# -- all .rb files in that directory are automatically loaded after loading

config/routes.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
Rails.application.routes.draw do
44
def dasherized_namespace(name, options = {}, &block)
55
options[:path] = name.to_s.dasherize
6-
namespace(name.to_s.underscore.to_sym, options, &block)
6+
namespace(name.to_s.underscore.to_sym, **options, &block)
77
end
88

99
def dasherized_resources(name, options = {}, &block)
1010
options[:controller] ||= name.to_s.underscore.to_sym
1111
options[:as] ||= name.to_s.underscore.to_sym
12-
resources(name.to_s.dasherize.to_sym, options, &block)
12+
resources(name.to_s.dasherize.to_sym, **options, &block)
1313
end
1414

1515
def dasherized_resource(name, options = {}, &block)
1616
options[:controller] ||= name.to_s.underscore.to_sym
1717
options[:as] ||= name.to_s.underscore.to_sym
18-
resource(name.to_s.dasherize.to_sym, options, &block)
18+
resource(name.to_s.dasherize.to_sym, **options, &block)
1919
end
2020

2121
devise_for :admin_users, ActiveAdmin::Devise.config

0 commit comments

Comments
 (0)