Rails 7.1 upgrade

This commit is contained in:
Ryan W
2023-09-30 09:57:54 -07:00
parent ba3da35c8f
commit fe041165e6
24 changed files with 498 additions and 213 deletions
+3 -5
View File
@@ -1,6 +1,4 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
APP_PATH = File.expand_path("../config/application", __dir__)
require_relative "../config/boot"
require "rails/commands"
+2 -4
View File
@@ -1,6 +1,4 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require_relative '../config/boot'
require 'rake'
require_relative "../config/boot"
require "rake"
Rake.application.run
+9 -11
View File
@@ -1,13 +1,11 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'fileutils'
require "fileutils"
# path to your application root.
APP_ROOT = File.expand_path('..', __dir__)
APP_ROOT = File.expand_path("..", __dir__)
def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
system(*args, exception: true)
end
FileUtils.chdir APP_ROOT do
@@ -15,9 +13,9 @@ FileUtils.chdir APP_ROOT do
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
# Add necessary setup steps to this file.
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')
puts "== Installing dependencies =="
system! "gem install bundler --conservative"
system("bundle check") || system!("bundle install")
# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
@@ -25,11 +23,11 @@ FileUtils.chdir APP_ROOT do
# end
puts "\n== Preparing database =="
system! 'bin/rails db:prepare'
system! "bin/rails db:prepare"
puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'
system! "bin/rails log:clear tmp:clear"
puts "\n== Restarting application server =="
system! 'bin/rails restart'
system! "bin/rails restart"
end