Skip to content

Commit cfa54b7

Browse files
authored
feat: upgrade to Rails 8.1 (#632)
This is focused on just having us generate apps with Rails 8.1 so its doing as little as possible which is why `bin/ci` and `config/ci` are just being removed - we might want to actually be using them as a way of running everything locally, but first someone needs to explore having them updated to reflect our actual CI stuff. `config/bundler-audit.yml` however is just something we'll never need as use `osv-detector` & `osv-scanner` for security auditing
1 parent 1b17758 commit cfa54b7

File tree

6 files changed

+26
-24
lines changed

6 files changed

+26
-24
lines changed

target_versions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# This is stored in a separate file so we can share it between the template and
44
# our CI configuration.
5-
target_rails_major_minor: '8.0' # specify as major.minor
5+
target_rails_major_minor: '8.1' # specify as major.minor
66

77
# Set this to the minimum version of Ruby that the chosen Rails version supports.
88
minimum_ruby_major_minor: '3.2'

variants/backend-base/app/template.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,3 @@
3535

3636
remove_dir ".github/"
3737
remove_dir "app/views/pwa"
38-
remove_file "bin/dev"
39-
remove_file "bin/thrust"

variants/backend-base/bin/template.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
copy_file "variants/backend-base/bin/#{bin}", "bin/#{bin}", force: true
33
chmod "bin/#{bin}", "+x"
44
end
5+
6+
remove_file "bin/ci"
7+
remove_file "bin/dev"
8+
remove_file "bin/thrust"

variants/backend-base/config/environments/production.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
RUBY
3333
gsub_file! "config/environments/production.rb",
3434
<<-RUBY,
35-
# Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit.
35+
# Specify outgoing SMTP server. Remember to add smtp/* credentials via bin/rails credentials:edit.
3636
# config.action_mailer.smtp_settings = {
3737
# user_name: Rails.application.credentials.dig(:smtp, :user_name),
3838
# password: Rails.application.credentials.dig(:smtp, :password),

variants/backend-base/config/environments/staging.rb.tt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
require_relative "production"
55

66
Rails.application.configure do
7-
87
config.action_mailer.default_url_options = {
98
host: "<%= TEMPLATE_CONFIG.staging_hostname %>",
109
protocol: "https"

variants/backend-base/config/template.rb

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
remove_file "config/master.key"
77
remove_file "config/credentials.yml.enc"
88

9+
remove_file "config/ci"
10+
remove_file "config/bundler-audit.yml"
11+
912
copy_file "variants/backend-base/config/puma.rb", "config/puma.rb", force: true
1013

1114
copy_file "variants/backend-base/config/initializers/generators.rb", "config/initializers/generators.rb"
@@ -57,23 +60,21 @@
5760
root "home#index"
5861
EO_ROUTES
5962

60-
if File.exist? "config/storage.yml"
61-
gsub_file! "config/storage.yml", /# service: S3/ do
62-
<<~YAML
63-
# service: S3
64-
# upload:
65-
# # TEAM DECISION REQUIRED: The correct caching duration for files
66-
# # stored by Active Storage is project dependent so you should discuss
67-
# # this with you team if you don't feel able to make the decision solo.
68-
# #
69-
# # These options are are not well documented in ActiveStorage. They
70-
# # are passed directly to the S3 SDK. Details:
71-
# # https://github.com/rails/rails/blob/master/activestorage/lib/active_storage/service/s3_service.rb
72-
# #
73-
# # * private: the browser should cache but intermediate proxies (e.g. CDNs) should not
74-
# # * max-age: the number of seconds to cache the file for
75-
# #
76-
# cache_control: 'private, max-age=<%= 365.days.seconds %>'
77-
YAML
78-
end
63+
gsub_file! "config/storage.yml", /# service: S3/ do
64+
<<~YAML
65+
# service: S3
66+
# upload:
67+
# # TEAM DECISION REQUIRED: The correct caching duration for files
68+
# # stored by Active Storage is project dependent so you should discuss
69+
# # this with you team if you don't feel able to make the decision solo.
70+
# #
71+
# # These options are are not well documented in ActiveStorage. They
72+
# # are passed directly to the S3 SDK. Details:
73+
# # https://github.com/rails/rails/blob/master/activestorage/lib/active_storage/service/s3_service.rb
74+
# #
75+
# # * private: the browser should cache but intermediate proxies (e.g. CDNs) should not
76+
# # * max-age: the number of seconds to cache the file for
77+
# #
78+
# cache_control: 'private, max-age=<%= 365.days.seconds %>'
79+
YAML
7980
end

0 commit comments

Comments
 (0)