Skip to content

Commit 6a1f7cc

Browse files
committed
Bump to rails 8
* Remove obosolete dependency from 12/2023 which was a proof of concept at the time. * Fix deprecated ``` DEPRECATION WARNING: `to_time` will always preserve the full timezone rather than offset of the receiver in Rails 8.1. To opt in to the new behavior, set `config.active_support.to_time_preserves_timezone = :zone`. ``` * `cucumber-rails` was not ready for rails 8, point to branch with some config change (no feature changed) cucumber/cucumber-rails#590 * `MalwareScan#analyzed_at` is a datetime, not an integer, which raises an error now in Rails 8
1 parent 9dab9d6 commit 6a1f7cc

7 files changed

+80
-135
lines changed

Gemfile

+3-4
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ gem 'propshaft'
3232
gem 'puma', '>= 5.0'
3333
gem 'pundit'
3434
gem 'ransack'
35-
gem 'rails', '~> 7.2.2'
36-
gem 'rails-i18n', '~> 7.0.10'
35+
gem 'rails', '~> 8.0'
36+
gem 'rails-i18n'
3737
gem 'redis', '>= 4.0.1'
3838
gem 'sentry-ruby'
3939
gem 'sentry-rails'
@@ -42,7 +42,6 @@ gem 'state_machines-activerecord'
4242
gem 'stimulus-rails'
4343
gem 'turbo-rails'
4444
gem 'tzinfo-data', platforms: %i[ windows jruby ]
45-
gem 'validates_timeliness', '~> 7.0.0.beta1'
4645
gem 'wicked'
4746

4847
group :development, :test do
@@ -69,7 +68,7 @@ end
6968

7069
group :test do
7170
gem 'capybara'
72-
gem 'cucumber-rails', require: false
71+
gem 'cucumber-rails', require: false, github: 'tagliala/cucumber-rails', branch: 'feature/589-rails-8'
7372
gem 'cuprite'
7473
gem 'database_cleaner-active_record'
7574
gem 'generator_spec'

Gemfile.lock

+74-73
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,55 @@
1+
GIT
2+
remote: https://github.com/tagliala/cucumber-rails.git
3+
revision: 499545f4233fa09e1c9833a40a18afd072d325aa
4+
branch: feature/589-rails-8
5+
specs:
6+
cucumber-rails (3.0.1)
7+
capybara (>= 3.11, < 4)
8+
cucumber (>= 5, < 10)
9+
railties (>= 5.2, < 8.1)
10+
111
GEM
212
remote: https://rubygems.org/
313
specs:
4-
actioncable (7.2.2)
5-
actionpack (= 7.2.2)
6-
activesupport (= 7.2.2)
14+
actioncable (8.0.0)
15+
actionpack (= 8.0.0)
16+
activesupport (= 8.0.0)
717
nio4r (~> 2.0)
818
websocket-driver (>= 0.6.1)
919
zeitwerk (~> 2.6)
10-
actionmailbox (7.2.2)
11-
actionpack (= 7.2.2)
12-
activejob (= 7.2.2)
13-
activerecord (= 7.2.2)
14-
activestorage (= 7.2.2)
15-
activesupport (= 7.2.2)
20+
actionmailbox (8.0.0)
21+
actionpack (= 8.0.0)
22+
activejob (= 8.0.0)
23+
activerecord (= 8.0.0)
24+
activestorage (= 8.0.0)
25+
activesupport (= 8.0.0)
1626
mail (>= 2.8.0)
17-
actionmailer (7.2.2)
18-
actionpack (= 7.2.2)
19-
actionview (= 7.2.2)
20-
activejob (= 7.2.2)
21-
activesupport (= 7.2.2)
27+
actionmailer (8.0.0)
28+
actionpack (= 8.0.0)
29+
actionview (= 8.0.0)
30+
activejob (= 8.0.0)
31+
activesupport (= 8.0.0)
2232
mail (>= 2.8.0)
2333
rails-dom-testing (~> 2.2)
24-
actionpack (7.2.2)
25-
actionview (= 7.2.2)
26-
activesupport (= 7.2.2)
34+
actionpack (8.0.0)
35+
actionview (= 8.0.0)
36+
activesupport (= 8.0.0)
2737
nokogiri (>= 1.8.5)
28-
racc
29-
rack (>= 2.2.4, < 3.2)
38+
rack (>= 2.2.4)
3039
rack-session (>= 1.0.1)
3140
rack-test (>= 0.6.3)
3241
rails-dom-testing (~> 2.2)
3342
rails-html-sanitizer (~> 1.6)
3443
useragent (~> 0.16)
35-
actiontext (7.2.2)
36-
actionpack (= 7.2.2)
37-
activerecord (= 7.2.2)
38-
activestorage (= 7.2.2)
39-
activesupport (= 7.2.2)
44+
actiontext (8.0.0)
45+
actionpack (= 8.0.0)
46+
activerecord (= 8.0.0)
47+
activestorage (= 8.0.0)
48+
activesupport (= 8.0.0)
4049
globalid (>= 0.6.0)
4150
nokogiri (>= 1.8.5)
42-
actionview (7.2.2)
43-
activesupport (= 7.2.2)
51+
actionview (8.0.0)
52+
activesupport (= 8.0.0)
4453
builder (~> 3.1)
4554
erubi (~> 1.11)
4655
rails-dom-testing (~> 2.2)
@@ -57,26 +66,26 @@ GEM
5766
activemodel (>= 6.1.4)
5867
activestorage (>= 6.1.4)
5968
activesupport (>= 6.1.4)
60-
activejob (7.2.2)
61-
activesupport (= 7.2.2)
69+
activejob (8.0.0)
70+
activesupport (= 8.0.0)
6271
globalid (>= 0.3.6)
63-
activemodel (7.2.2)
64-
activesupport (= 7.2.2)
72+
activemodel (8.0.0)
73+
activesupport (= 8.0.0)
6574
activemodel-serializers-xml (1.0.2)
6675
activemodel (> 5.x)
6776
activesupport (> 5.x)
6877
builder (~> 3.1)
69-
activerecord (7.2.2)
70-
activemodel (= 7.2.2)
71-
activesupport (= 7.2.2)
78+
activerecord (8.0.0)
79+
activemodel (= 8.0.0)
80+
activesupport (= 8.0.0)
7281
timeout (>= 0.4.0)
73-
activestorage (7.2.2)
74-
actionpack (= 7.2.2)
75-
activejob (= 7.2.2)
76-
activerecord (= 7.2.2)
77-
activesupport (= 7.2.2)
82+
activestorage (8.0.0)
83+
actionpack (= 8.0.0)
84+
activejob (= 8.0.0)
85+
activerecord (= 8.0.0)
86+
activesupport (= 8.0.0)
7887
marcel (~> 1.0)
79-
activesupport (7.2.2)
88+
activesupport (8.0.0)
8089
base64
8190
benchmark (>= 0.3)
8291
bigdecimal
@@ -88,6 +97,7 @@ GEM
8897
minitest (>= 5.1)
8998
securerandom (>= 0.3)
9099
tzinfo (~> 2.0, >= 2.0.5)
100+
uri (>= 0.13.1)
91101
addressable (2.8.7)
92102
public_suffix (>= 2.0.2, < 7.0)
93103
ast (2.4.2)
@@ -162,10 +172,6 @@ GEM
162172
cucumber-html-formatter (21.7.0)
163173
cucumber-messages (> 19, < 27)
164174
cucumber-messages (22.0.0)
165-
cucumber-rails (3.0.1)
166-
capybara (>= 3.11, < 4)
167-
cucumber (>= 5, < 10)
168-
railties (>= 5.2, < 8)
169175
cucumber-tag-expressions (6.1.1)
170176
cuprite (0.15.1)
171177
capybara (~> 3.0)
@@ -336,7 +342,7 @@ GEM
336342
nenv (0.3.0)
337343
net-http (0.4.1)
338344
uri
339-
net-imap (0.5.0)
345+
net-imap (0.5.1)
340346
date
341347
net-protocol
342348
net-pop (0.1.2)
@@ -407,20 +413,20 @@ GEM
407413
rack (>= 1.0.0)
408414
rackup (2.2.0)
409415
rack (>= 3)
410-
rails (7.2.2)
411-
actioncable (= 7.2.2)
412-
actionmailbox (= 7.2.2)
413-
actionmailer (= 7.2.2)
414-
actionpack (= 7.2.2)
415-
actiontext (= 7.2.2)
416-
actionview (= 7.2.2)
417-
activejob (= 7.2.2)
418-
activemodel (= 7.2.2)
419-
activerecord (= 7.2.2)
420-
activestorage (= 7.2.2)
421-
activesupport (= 7.2.2)
416+
rails (8.0.0)
417+
actioncable (= 8.0.0)
418+
actionmailbox (= 8.0.0)
419+
actionmailer (= 8.0.0)
420+
actionpack (= 8.0.0)
421+
actiontext (= 8.0.0)
422+
actionview (= 8.0.0)
423+
activejob (= 8.0.0)
424+
activemodel (= 8.0.0)
425+
activerecord (= 8.0.0)
426+
activestorage (= 8.0.0)
427+
activesupport (= 8.0.0)
422428
bundler (>= 1.15.0)
423-
railties (= 7.2.2)
429+
railties (= 8.0.0)
424430
rails-controller-testing (1.0.5)
425431
actionpack (>= 5.0.1.rc1)
426432
actionview (>= 5.0.1.rc1)
@@ -432,12 +438,12 @@ GEM
432438
rails-html-sanitizer (1.6.0)
433439
loofah (~> 2.21)
434440
nokogiri (~> 1.14)
435-
rails-i18n (7.0.10)
441+
rails-i18n (8.0.1)
436442
i18n (>= 0.7, < 2)
437-
railties (>= 6.0.0, < 8)
438-
railties (7.2.2)
439-
actionpack (= 7.2.2)
440-
activesupport (= 7.2.2)
443+
railties (>= 8.0.0, < 9)
444+
railties (8.0.0)
445+
actionpack (= 8.0.0)
446+
activesupport (= 8.0.0)
441447
irb (~> 1.13)
442448
rackup (>= 1.0.0)
443449
rake (>= 12.2)
@@ -513,7 +519,7 @@ GEM
513519
rubocop (~> 1.61)
514520
ruby-progressbar (1.13.0)
515521
ruby2_keywords (0.0.5)
516-
securerandom (0.3.1)
522+
securerandom (0.3.2)
517523
sentry-rails (5.21.0)
518524
railties (>= 5.0)
519525
sentry-ruby (~> 5.21.0)
@@ -548,8 +554,7 @@ GEM
548554
terminal-table (3.0.2)
549555
unicode-display_width (>= 1.1.1, < 3)
550556
thor (1.3.2)
551-
timeliness (0.4.5)
552-
timeout (0.4.1)
557+
timeout (0.4.2)
553558
turbo-rails (2.0.11)
554559
actionpack (>= 6.0.0)
555560
railties (>= 6.0.0)
@@ -559,11 +564,8 @@ GEM
559564
concurrent-ruby (~> 1.0)
560565
unicode-display_width (2.6.0)
561566
uniform_notifier (1.16.0)
562-
uri (0.13.1)
567+
uri (1.0.1)
563568
useragent (0.16.10)
564-
validates_timeliness (7.0.0.beta2)
565-
activemodel (>= 7.0.0, < 8)
566-
timeliness (>= 0.3.10, < 1)
567569
version_gem (1.1.3)
568570
web-console (4.2.1)
569571
actionview (>= 6.0.0)
@@ -604,7 +606,7 @@ DEPENDENCIES
604606
bullet
605607
byebug
606608
capybara
607-
cucumber-rails
609+
cucumber-rails!
608610
cuprite
609611
database_cleaner-active_record
610612
debug
@@ -639,9 +641,9 @@ DEPENDENCIES
639641
puma (>= 5.0)
640642
pundit
641643
rack_session_access
642-
rails (~> 7.2.2)
644+
rails (~> 8.0)
643645
rails-controller-testing
644-
rails-i18n (~> 7.0.10)
646+
rails-i18n
645647
ransack
646648
redis (>= 4.0.1)
647649
rspec-rails (= 7.1.0)
@@ -659,7 +661,6 @@ DEPENDENCIES
659661
stimulus-rails
660662
turbo-rails
661663
tzinfo-data
662-
validates_timeliness (~> 7.0.0.beta1)
663664
web-console
664665
webmock
665666
wicked

app/jobs/malware_scan_retrieve_state_job.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def perform(malware_scan_id)
2323

2424
malware_scan.update!(safety_state:, analyzed_at: Time.zone.at(result_analyze[:analyzed_at]))
2525
rescue MalwareScanRetrieveStateJobError, Faraday::ServerError, Faraday::ConnectionFailed
26-
malware_scan.update!(safety_state: :unknown, analyzed_at: Time.zone.now.to_i) if attempts == RETRIES
26+
malware_scan.update!(safety_state: :unknown, analyzed_at: Time.zone.now) if attempts == RETRIES
2727
end
2828

2929
private

config/application.rb

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class Application < Rails::Application
3030

3131
config.default_from = '[email protected]'
3232

33+
config.active_support.to_time_preserves_timezone = :zone
34+
3335
# Configuration for the application, engines, and railties goes here.
3436
#
3537
# These settings can be overridden in specific environments using the files

config/i18n-tasks.yml

-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ ignore_unused:
125125
- "{activerecord,activemodel}.errors.*"
126126
- "ransack.attributes.*"
127127
- "errors.messages.*"
128-
- "validates_timeliness.error_value_formats.*"
129128
- "authorization_request_forms.*"
130129
- "authorization_request_mailer.*.subject"
131130
- "support.*"

config/initializers/validates_timeliness.rb

-40
This file was deleted.

config/locales/validates_timeliness.fr.yml

-16
This file was deleted.

0 commit comments

Comments
 (0)