Skip to content

Commit 8687e58

Browse files
authored
Merge pull request #16 from nativeapptemplate/upgrade_rails_8_0
Upgrade Rails from 7.2.3 to 8.0.4
2 parents abab4a3 + 1f734c6 commit 8687e58

16 files changed

Lines changed: 156 additions & 260 deletions

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
This is a Rails 7.2 API application that serves as the backend for NativeAppTemplate iOS/Android mobile applications. It's a multi-tenant SaaS application with token-based authentication, role-based authorization, and RESTful API endpoints. Ruby 4.0.1, PostgreSQL, Redis, Sidekiq.
7+
This is a Rails 8.0 API application that serves as the backend for NativeAppTemplate iOS/Android mobile applications. It's a multi-tenant SaaS application with token-based authentication, role-based authorization, and RESTful API endpoints. Ruby 4.0.1, PostgreSQL, Redis, Sidekiq.
88

99
## Development Commands
1010

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
44
ruby file: ".ruby-version"
55

66
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
7-
gem "rails", "~> 7.2.3"
7+
gem "rails", "~> 8.0.0"
88

99
gem "propshaft", "~> 1.0"
1010

Gemfile.lock

Lines changed: 73 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -13,68 +13,65 @@ GEM
1313
specs:
1414
aasm (5.5.0)
1515
concurrent-ruby (~> 1.0)
16-
actioncable (7.2.3)
17-
actionpack (= 7.2.3)
18-
activesupport (= 7.2.3)
16+
actioncable (8.0.4)
17+
actionpack (= 8.0.4)
18+
activesupport (= 8.0.4)
1919
nio4r (~> 2.0)
2020
websocket-driver (>= 0.6.1)
2121
zeitwerk (~> 2.6)
22-
actionmailbox (7.2.3)
23-
actionpack (= 7.2.3)
24-
activejob (= 7.2.3)
25-
activerecord (= 7.2.3)
26-
activestorage (= 7.2.3)
27-
activesupport (= 7.2.3)
22+
actionmailbox (8.0.4)
23+
actionpack (= 8.0.4)
24+
activejob (= 8.0.4)
25+
activerecord (= 8.0.4)
26+
activestorage (= 8.0.4)
27+
activesupport (= 8.0.4)
2828
mail (>= 2.8.0)
29-
actionmailer (7.2.3)
30-
actionpack (= 7.2.3)
31-
actionview (= 7.2.3)
32-
activejob (= 7.2.3)
33-
activesupport (= 7.2.3)
29+
actionmailer (8.0.4)
30+
actionpack (= 8.0.4)
31+
actionview (= 8.0.4)
32+
activejob (= 8.0.4)
33+
activesupport (= 8.0.4)
3434
mail (>= 2.8.0)
3535
rails-dom-testing (~> 2.2)
36-
actionpack (7.2.3)
37-
actionview (= 7.2.3)
38-
activesupport (= 7.2.3)
39-
cgi
36+
actionpack (8.0.4)
37+
actionview (= 8.0.4)
38+
activesupport (= 8.0.4)
4039
nokogiri (>= 1.8.5)
41-
racc
42-
rack (>= 2.2.4, < 3.3)
40+
rack (>= 2.2.4)
4341
rack-session (>= 1.0.1)
4442
rack-test (>= 0.6.3)
4543
rails-dom-testing (~> 2.2)
4644
rails-html-sanitizer (~> 1.6)
4745
useragent (~> 0.16)
48-
actiontext (7.2.3)
49-
actionpack (= 7.2.3)
50-
activerecord (= 7.2.3)
51-
activestorage (= 7.2.3)
52-
activesupport (= 7.2.3)
46+
actiontext (8.0.4)
47+
actionpack (= 8.0.4)
48+
activerecord (= 8.0.4)
49+
activestorage (= 8.0.4)
50+
activesupport (= 8.0.4)
5351
globalid (>= 0.6.0)
5452
nokogiri (>= 1.8.5)
55-
actionview (7.2.3)
56-
activesupport (= 7.2.3)
53+
actionview (8.0.4)
54+
activesupport (= 8.0.4)
5755
builder (~> 3.1)
58-
cgi
5956
erubi (~> 1.11)
6057
rails-dom-testing (~> 2.2)
6158
rails-html-sanitizer (~> 1.6)
62-
activejob (7.2.3)
63-
activesupport (= 7.2.3)
59+
activejob (8.0.4)
60+
activesupport (= 8.0.4)
6461
globalid (>= 0.3.6)
65-
activemodel (7.2.3)
66-
activesupport (= 7.2.3)
67-
activerecord (7.2.3)
68-
activemodel (= 7.2.3)
69-
activesupport (= 7.2.3)
62+
activemodel (8.0.4)
63+
activesupport (= 8.0.4)
64+
activerecord (8.0.4)
65+
activemodel (= 8.0.4)
66+
activesupport (= 8.0.4)
7067
timeout (>= 0.4.0)
71-
activestorage (7.2.3)
72-
actionpack (= 7.2.3)
73-
activejob (= 7.2.3)
74-
activerecord (= 7.2.3)
75-
activesupport (= 7.2.3)
68+
activestorage (8.0.4)
69+
actionpack (= 8.0.4)
70+
activejob (= 8.0.4)
71+
activerecord (= 8.0.4)
72+
activesupport (= 8.0.4)
7673
marcel (~> 1.0)
77-
activesupport (7.2.3)
74+
activesupport (8.0.4)
7875
base64
7976
benchmark (>= 0.3)
8077
bigdecimal
@@ -86,6 +83,7 @@ GEM
8683
minitest (>= 5.1)
8784
securerandom (>= 0.3)
8885
tzinfo (~> 2.0, >= 2.0.5)
86+
uri (>= 0.13.1)
8987
acts_as_tenant (1.0.1)
9088
rails (>= 6.0)
9189
addressable (2.8.7)
@@ -120,7 +118,6 @@ GEM
120118
rack-test (>= 0.6.3)
121119
regexp_parser (>= 1.5, < 3.0)
122120
xpath (~> 3.2)
123-
cgi (0.5.1)
124121
childprocess (5.1.0)
125122
logger (~> 1.5)
126123
chronic (0.10.2)
@@ -147,12 +144,12 @@ GEM
147144
railties (>= 4.1.0)
148145
responders
149146
warden (~> 1.2.3)
150-
devise_token_auth (1.2.5)
147+
devise_token_auth (1.2.6)
151148
bcrypt (~> 3.0)
152149
devise (> 3.5.2, < 5)
153-
rails (>= 4.2.0, < 8.1)
150+
rails (>= 4.2.0, < 8.2)
154151
drb (2.2.3)
155-
erb (6.0.1)
152+
erb (6.0.2)
156153
erb_lint (0.9.0)
157154
activesupport
158155
better_html (>= 2.0.1)
@@ -185,8 +182,9 @@ GEM
185182
activesupport (>= 3.0)
186183
nokogiri (>= 1.6)
187184
io-console (0.8.2)
188-
irb (1.16.0)
185+
irb (1.17.0)
189186
pp (>= 0.6.0)
187+
prism (>= 1.3.0)
190188
rdoc (>= 4.0.0)
191189
reline (>= 0.4.2)
192190
jbuilder (2.13.0)
@@ -225,7 +223,7 @@ GEM
225223
mini_portile2 (2.8.9)
226224
minitest (5.27.0)
227225
msgpack (1.8.0)
228-
net-imap (0.6.2)
226+
net-imap (0.6.3)
229227
date
230228
net-protocol
231229
net-pop (0.1.2)
@@ -235,18 +233,18 @@ GEM
235233
net-smtp (0.5.1)
236234
net-protocol
237235
nio4r (2.7.5)
238-
nokogiri (1.19.0)
236+
nokogiri (1.19.1)
239237
mini_portile2 (~> 2.8.2)
240238
racc (~> 1.4)
241-
nokogiri (1.19.0-aarch64-linux-gnu)
239+
nokogiri (1.19.1-aarch64-linux-gnu)
242240
racc (~> 1.4)
243-
nokogiri (1.19.0-arm-linux-gnu)
241+
nokogiri (1.19.1-arm-linux-gnu)
244242
racc (~> 1.4)
245-
nokogiri (1.19.0-arm64-darwin)
243+
nokogiri (1.19.1-arm64-darwin)
246244
racc (~> 1.4)
247-
nokogiri (1.19.0-x86_64-darwin)
245+
nokogiri (1.19.1-x86_64-darwin)
248246
racc (~> 1.4)
249-
nokogiri (1.19.0-x86_64-linux-gnu)
247+
nokogiri (1.19.1-x86_64-linux-gnu)
250248
racc (~> 1.4)
251249
orm_adapter (0.5.0)
252250
ostruct (0.6.1)
@@ -290,31 +288,30 @@ GEM
290288
rack (>= 1.3)
291289
rackup (2.3.1)
292290
rack (>= 3)
293-
rails (7.2.3)
294-
actioncable (= 7.2.3)
295-
actionmailbox (= 7.2.3)
296-
actionmailer (= 7.2.3)
297-
actionpack (= 7.2.3)
298-
actiontext (= 7.2.3)
299-
actionview (= 7.2.3)
300-
activejob (= 7.2.3)
301-
activemodel (= 7.2.3)
302-
activerecord (= 7.2.3)
303-
activestorage (= 7.2.3)
304-
activesupport (= 7.2.3)
291+
rails (8.0.4)
292+
actioncable (= 8.0.4)
293+
actionmailbox (= 8.0.4)
294+
actionmailer (= 8.0.4)
295+
actionpack (= 8.0.4)
296+
actiontext (= 8.0.4)
297+
actionview (= 8.0.4)
298+
activejob (= 8.0.4)
299+
activemodel (= 8.0.4)
300+
activerecord (= 8.0.4)
301+
activestorage (= 8.0.4)
302+
activesupport (= 8.0.4)
305303
bundler (>= 1.15.0)
306-
railties (= 7.2.3)
304+
railties (= 8.0.4)
307305
rails-dom-testing (2.3.0)
308306
activesupport (>= 5.0.0)
309307
minitest
310308
nokogiri (>= 1.6)
311-
rails-html-sanitizer (1.6.2)
312-
loofah (~> 2.21)
309+
rails-html-sanitizer (1.7.0)
310+
loofah (~> 2.25)
313311
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
314-
railties (7.2.3)
315-
actionpack (= 7.2.3)
316-
activesupport (= 7.2.3)
317-
cgi
312+
railties (8.0.4)
313+
actionpack (= 8.0.4)
314+
activesupport (= 8.0.4)
318315
irb (~> 1.13)
319316
rackup (>= 1.0.0)
320317
rake (>= 12.2)
@@ -323,7 +320,7 @@ GEM
323320
zeitwerk (~> 2.6)
324321
rainbow (3.1.1)
325322
rake (13.3.1)
326-
rdoc (7.0.3)
323+
rdoc (7.2.0)
327324
erb
328325
psych (>= 4.0.0)
329326
tsort
@@ -408,6 +405,7 @@ GEM
408405
unicode-display_width (3.2.0)
409406
unicode-emoji (~> 4.1)
410407
unicode-emoji (4.2.0)
408+
uri (1.1.1)
411409
useragent (0.16.11)
412410
valid_email2 (7.0.0)
413411
activemodel (>= 6.0)
@@ -432,7 +430,7 @@ GEM
432430
chronic (>= 0.6.3)
433431
xpath (3.2.0)
434432
nokogiri (~> 1.8)
435-
zeitwerk (2.7.4)
433+
zeitwerk (2.7.5)
436434

437435
PLATFORMS
438436
aarch64-linux
@@ -472,7 +470,7 @@ DEPENDENCIES
472470
pundit
473471
rack-attack
474472
rack-cors
475-
rails (~> 7.2.3)
473+
rails (~> 8.0.0)
476474
redis (~> 5.1)
477475
rubocop-rails-omakase
478476
seed-fu (~> 2.3)

app/models/app_version.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class AppVersion < ApplicationRecord
2-
enum current_type: {uncurrent: 1, current: 2}
3-
enum forced_update_type: {unforced_update: 1, forced_update: 2}
2+
enum :current_type, {uncurrent: 1, current: 2}
3+
enum :forced_update_type, {unforced_update: 1, forced_update: 2}
44

55
def self.current_version(platform:)
66
AppVersion

app/models/item_tag.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ class ItemTag < ApplicationRecord
77
belongs_to :created_by, class_name: "Shopkeeper", optional: true
88
belongs_to :completed_by, class_name: "Shopkeeper", optional: true
99

10-
enum state: {idled: 1, completed: 2}
11-
enum scan_state: {unscanned: 1, scanned: 2}
10+
enum :state, {idled: 1, completed: 2}
11+
enum :scan_state, {unscanned: 1, scanned: 2}
1212

1313
scope :sorted, -> { order(queue_number: :asc) }
1414
scope :sorted_recent_first_order, -> { order(completed_at: :desc) }

app/models/privacy_version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class PrivacyVersion < ApplicationRecord
2-
enum current_type: {uncurrent: 1, current: 2}
2+
enum :current_type, {uncurrent: 1, current: 2}
33

44
def self.current_version
55
PrivacyVersion

app/models/terms_version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class TermsVersion < ApplicationRecord
2-
enum current_type: {uncurrent: 1, current: 2}
2+
enum :current_type, {uncurrent: 1, current: 2}
33

44
def self.current_version
55
TermsVersion

bin/dev

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33
# Default to port 3000 if not specified
44
export PORT="${PORT:-3000}"
55

6-
if command -v overmind > /dev/null 2>&1; then
7-
exec overmind start -f Procfile.dev "$@"
8-
else
9-
if ! gem list foreman -i --silent; then
10-
echo "Installing foreman..."
11-
gem install foreman
12-
fi
13-
exec foreman start -f Procfile.dev "$@"
6+
if ! command -v overmind 2>&1 >/dev/null; then
7+
gem install overmind
148
fi
9+
10+
exec overmind start -T -f Procfile.dev "$@"

config/application.rb

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
module Nativeapptemplateapi
1010
class Application < Rails::Application
1111
# Initialize configuration defaults for originally generated Rails version.
12-
config.load_defaults 7.1
12+
config.load_defaults 8.0
1313

1414
# Please, add to the `ignore` list any other `lib` subdirectories that do
1515
# not contain `.rb` files, or that should not be reloaded or eager loaded.
@@ -40,23 +40,6 @@ class Application < Rails::Application
4040
# Use default language as fallback if translation is missing
4141
config.i18n.fallbacks = true
4242

43-
# Prevent sassc-rails from setting sass as the compressor
44-
# Libsass is deprecated and doesn't support modern CSS syntax used by TailwindCSS
45-
config.assets.css_compressor = nil
46-
47-
# Rails 7 defaults to libvips as the variant processor
48-
# libvips is up to 10x faster and consumes 1/10th the memory of imagemagick
49-
# If you need to use imagemagick, uncomment this to switch
50-
# config.active_storage.variant_processor = :mini_magick
51-
52-
# Support older SHA1 digests for ActiveStorage so ActionText attachments don't break
53-
config.after_initialize do |app|
54-
app.message_verifier("ActiveStorage").rotate(digest: "SHA1")
55-
end
56-
57-
# Support older SHA1 digests for ActiveRecord::Encryption
58-
config.active_record.encryption.support_sha1_for_non_deterministic_encryption = true
59-
6043
config.active_model.i18n_customize_full_message = true
6144

6245
# https://github.com/heartcombo/devise/issues/4825

0 commit comments

Comments
 (0)