Skip to content

Commit

Permalink
Update to Rails 8.0 (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
jxjj authored Dec 23, 2024
1 parent 5ab1424 commit 6031e69
Show file tree
Hide file tree
Showing 16 changed files with 821 additions and 397 deletions.
9 changes: 5 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ gem 'omniauth-shibboleth', "~> 1.1"
gem 'omniauth-shibboleth-passive', "~> 0.1"

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 7.1'
gem 'rails', '~> 8.0'
# Use mysql2 as the database for Active Record
gem 'mysql2', "~> 0.5"
# Use sqlite also
Expand Down Expand Up @@ -45,7 +45,7 @@ gem 'twitter-typeahead-rails', git: 'https://github.com/pgate/twitter-typeahead-
gem 'net-ldap', "~> 0.16"

# Use bootstrap for styling
gem 'twitter-bootstrap-rails', git: 'https://github.com/seyhunak/twitter-bootstrap-rails.git'
gem 'twitter-bootstrap-rails', git: 'https://github.com/UMN-LATIS/twitter-bootstrap-rails.git'

# Use special bootstrap select
gem 'bootstrap-select-rails', "~> 1.13"
Expand Down Expand Up @@ -73,7 +73,7 @@ gem 'starburst', github: 'UMN-LATIS/starburst', branch: 'feature/rails-7'

# notify someone when exceptions occur
# and notify slack channel
gem 'exception_notification', "~> 4.4"
gem 'exception_notification', git: "https://github.com/smartinez87/exception_notification.git"
gem 'slack-notifier', "~> 2.3"

# For URL migration
Expand Down Expand Up @@ -148,7 +148,8 @@ group :development do
gem "rubocop-rspec", "~> 2.4", require: false

# Use annotate to list the attributes of models
gem 'annotate', "~> 3.1"
# gem 'annotate', "~> 3.2"
# TODO: fix to work with Rails 8 or move to annotaterb?

gem 'bcrypt_pbkdf', "~> 1.1"
gem 'capistrano', "~> 3.19"
Expand Down
146 changes: 74 additions & 72 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ GIT
starburst (2.0.0.rc0)
rails (>= 4.2.0)

GIT
remote: https://github.com/UMN-LATIS/twitter-bootstrap-rails.git
revision: 441803d95edc44291eb8526fac8338f0d469547a
specs:
twitter-bootstrap-rails (5.0.0)
actionpack (>= 5.0, < 9.0)
execjs (~> 2.7)
less-rails (>= 3.0, < 5.0)
railties (>= 5.0, < 9.0)

GIT
remote: https://github.com/pgate/twitter-typeahead-rails.git
revision: 105a036048eb4c19a1d5c0bb7aec55346c8b506d
Expand All @@ -16,78 +26,75 @@ GIT
railties (>= 3.1)

GIT
remote: https://github.com/seyhunak/twitter-bootstrap-rails.git
revision: 6e0fbcb0b200f2dac8a40a5cfec54e7c7b35f442
remote: https://github.com/smartinez87/exception_notification.git
revision: 60e158888bbff96f7a9ae00ae97305cdd33726e9
specs:
twitter-bootstrap-rails (5.0.0)
actionpack (>= 5.0, < 8.0)
execjs (~> 2.7)
less-rails (>= 3.0, < 5.0)
railties (>= 5.0, < 8.0)
exception_notification (4.5.0)
actionmailer (>= 5.2, < 9)
activesupport (>= 5.2, < 9)

GEM
remote: https://rubygems.org/
specs:
actioncable (7.2.2.1)
actionpack (= 7.2.2.1)
activesupport (= 7.2.2.1)
actioncable (8.0.1)
actionpack (= 8.0.1)
activesupport (= 8.0.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.2.2.1)
actionpack (= 7.2.2.1)
activejob (= 7.2.2.1)
activerecord (= 7.2.2.1)
activestorage (= 7.2.2.1)
activesupport (= 7.2.2.1)
actionmailbox (8.0.1)
actionpack (= 8.0.1)
activejob (= 8.0.1)
activerecord (= 8.0.1)
activestorage (= 8.0.1)
activesupport (= 8.0.1)
mail (>= 2.8.0)
actionmailer (7.2.2.1)
actionpack (= 7.2.2.1)
actionview (= 7.2.2.1)
activejob (= 7.2.2.1)
activesupport (= 7.2.2.1)
actionmailer (8.0.1)
actionpack (= 8.0.1)
actionview (= 8.0.1)
activejob (= 8.0.1)
activesupport (= 8.0.1)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.2.2.1)
actionview (= 7.2.2.1)
activesupport (= 7.2.2.1)
actionpack (8.0.1)
actionview (= 8.0.1)
activesupport (= 8.0.1)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4, < 3.2)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actiontext (7.2.2.1)
actionpack (= 7.2.2.1)
activerecord (= 7.2.2.1)
activestorage (= 7.2.2.1)
activesupport (= 7.2.2.1)
actiontext (8.0.1)
actionpack (= 8.0.1)
activerecord (= 8.0.1)
activestorage (= 8.0.1)
activesupport (= 8.0.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.2.2.1)
activesupport (= 7.2.2.1)
actionview (8.0.1)
activesupport (= 8.0.1)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.2.2.1)
activesupport (= 7.2.2.1)
activejob (8.0.1)
activesupport (= 8.0.1)
globalid (>= 0.3.6)
activemodel (7.2.2.1)
activesupport (= 7.2.2.1)
activerecord (7.2.2.1)
activemodel (= 7.2.2.1)
activesupport (= 7.2.2.1)
activemodel (8.0.1)
activesupport (= 8.0.1)
activerecord (8.0.1)
activemodel (= 8.0.1)
activesupport (= 8.0.1)
timeout (>= 0.4.0)
activestorage (7.2.2.1)
actionpack (= 7.2.2.1)
activejob (= 7.2.2.1)
activerecord (= 7.2.2.1)
activesupport (= 7.2.2.1)
activestorage (8.0.1)
actionpack (= 8.0.1)
activejob (= 8.0.1)
activerecord (= 8.0.1)
activesupport (= 8.0.1)
marcel (~> 1.0)
activesupport (7.2.2.1)
activesupport (8.0.1)
base64
benchmark (>= 0.3)
bigdecimal
Expand All @@ -99,16 +106,14 @@ GEM
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
airbrussh (1.5.3)
sshkit (>= 1.6.1, != 1.7.0)
ajax-datatables-rails (1.5.0)
rails (>= 6.0)
zeitwerk
annotate (3.2.0)
activerecord (>= 3.2, < 8.0)
rake (>= 10.4, < 14.0)
ast (2.4.2)
awesome_print (1.9.2)
base64 (0.1.1)
Expand Down Expand Up @@ -175,9 +180,6 @@ GEM
dry-cli (1.2.0)
ed25519 (1.3.0)
erubi (1.13.1)
exception_notification (4.5.0)
actionmailer (>= 5.2, < 8)
activesupport (>= 5.2, < 8)
execjs (2.10.0)
factory_bot (6.5.0)
activesupport (>= 5.0.0)
Expand Down Expand Up @@ -287,7 +289,7 @@ GEM
mutex_m (0.3.0)
mysql2 (0.5.6)
nenv (0.3.0)
net-imap (0.5.3)
net-imap (0.5.4)
date
net-protocol
net-ldap (0.19.0)
Expand Down Expand Up @@ -360,30 +362,30 @@ GEM
rackup (1.0.1)
rack (< 3)
webrick
rails (7.2.2.1)
actioncable (= 7.2.2.1)
actionmailbox (= 7.2.2.1)
actionmailer (= 7.2.2.1)
actionpack (= 7.2.2.1)
actiontext (= 7.2.2.1)
actionview (= 7.2.2.1)
activejob (= 7.2.2.1)
activemodel (= 7.2.2.1)
activerecord (= 7.2.2.1)
activestorage (= 7.2.2.1)
activesupport (= 7.2.2.1)
rails (8.0.1)
actioncable (= 8.0.1)
actionmailbox (= 8.0.1)
actionmailer (= 8.0.1)
actionpack (= 8.0.1)
actiontext (= 8.0.1)
actionview (= 8.0.1)
activejob (= 8.0.1)
activemodel (= 8.0.1)
activerecord (= 8.0.1)
activestorage (= 8.0.1)
activesupport (= 8.0.1)
bundler (>= 1.15.0)
railties (= 7.2.2.1)
railties (= 8.0.1)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.2)
loofah (~> 2.21)
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)
railties (7.2.2.1)
actionpack (= 7.2.2.1)
activesupport (= 7.2.2.1)
railties (8.0.1)
actionpack (= 8.0.1)
activesupport (= 8.0.1)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
Expand Down Expand Up @@ -523,6 +525,7 @@ GEM
unicode-display_width (3.1.2)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
uri (1.0.2)
useragent (0.16.11)
vite_rails (3.0.19)
railties (>= 5.1, < 9)
Expand Down Expand Up @@ -554,7 +557,6 @@ PLATFORMS
DEPENDENCIES
addressable (~> 2.8)
ajax-datatables-rails (~> 1.4)
annotate (~> 3.1)
awesome_print (~> 1.8)
bcrypt_pbkdf (~> 1.1)
better_errors (~> 2.7)
Expand All @@ -574,7 +576,7 @@ DEPENDENCIES
database_cleaner-active_record (~> 2.2)
dotenv-rails (~> 2.7)
ed25519 (~> 1.2)
exception_notification (~> 4.4)
exception_notification!
factory_bot_rails (~> 6.2)
font-awesome-rails (~> 4.7)
foreman
Expand All @@ -601,7 +603,7 @@ DEPENDENCIES
puma (~> 6.0)
pundit (~> 2.1)
rack-utf8_sanitizer (~> 1.7)
rails (~> 7.1)
rails (~> 8.0)
rqrcode (~> 2.2)
rspec-rails (~> 6.1, >= 6.1.2)
rspec-retry (~> 0.6)
Expand Down
12 changes: 5 additions & 7 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ FileUtils.chdir APP_ROOT do
# Add necessary setup steps to this file.

puts "== Installing dependencies =="
system! "gem install bundler --conservative"
system("bundle check") || system!("bundle install")

# puts "\n== Copying sample files =="
Expand All @@ -29,10 +28,9 @@ FileUtils.chdir APP_ROOT do
puts "\n== Removing old logs and tempfiles =="
system! "bin/rails log:clear tmp:clear"

puts "\n== Restarting application server =="
system! "bin/rails restart"

# puts "\n== Configuring puma-dev =="
# system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
# system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
unless ARGV.include?("--skip-server")
puts "\n== Starting development server =="
STDOUT.flush # flush the output before exec(2) so that it displays
exec "bin/dev"
end
end
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
module Z
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.2
config.load_defaults 8.0

# continue to use `config/secrets.yml` for secrets (removed in 7.2 in lieu of `credentials.yml.enc`)
config.secret_key_base = config_for(:secrets).fetch(:secret_key_base)
Expand Down
20 changes: 13 additions & 7 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

# In the development environment your application's code is reloaded any time
# it changes. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
# Make code changes take effect immediately without server restart.
config.enable_reloading = true

# Do not eager load code on boot.
Expand All @@ -14,11 +12,11 @@
# Show full error reports.
config.consider_all_requests_local = true

# Enable server timing
# Enable server timing.
config.server_timing = true

# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
# Enable/disable Action Controller caching. By default Action Controller caching is disabled.
# Run rails dev:cache to toggle Action Controller caching.
if Rails.root.join("tmp/caching-dev.txt").exist?
config.action_controller.perform_caching = true
config.action_controller.enable_fragment_cache_logging = true
Expand All @@ -39,8 +37,10 @@
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false

# Make template changes take effect immediately.
config.action_mailer.perform_caching = false

# Set localhost to be used by links generated in mailer templates.
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }

# Print deprecation notices to the Rails logger.
Expand All @@ -58,6 +58,9 @@
# Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = true

# Append comments with runtime information tags to SQL queries in logs.
config.active_record.query_log_tags_enabled = true

# Highlight code that enqueued background job in logs.
config.active_job.verbose_enqueue_logs = true

Expand All @@ -73,8 +76,11 @@
# Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true

# Raise error when a before_action's only/except options reference missing actions
# Raise error when a before_action's only/except options reference missing actions.
config.action_controller.raise_on_missing_callback_actions = true

config.omniauth_provider = 'developer'

# Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
# config.generators.apply_rubocop_autocorrect_after_generate!
end
Loading

0 comments on commit 6031e69

Please sign in to comment.