Skip to content

Commit

Permalink
Merge pull request #2277 from glowfic-constellation/upgrade/rails-7-2
Browse files Browse the repository at this point in the history
Upgrade to Rails 7.2
  • Loading branch information
Throne3d authored Nov 24, 2024
2 parents e9d9d1e + bdb9f1f commit 3037925
Show file tree
Hide file tree
Showing 22 changed files with 318 additions and 178 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ gem 'nokogiri'
gem 'pg', '~> 1.5'
gem 'pg_search'
gem 'rack-pratchett'
gem 'rails', '~> 7.1.5'
gem 'rails', '~> 7.2.2'
gem "redcarpet", "~> 3.6"
gem 'redis', '~> 5.3'
gem 'request_store', '~> 1.7'
Expand Down
130 changes: 62 additions & 68 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,83 +1,77 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (7.1.5)
actionpack (= 7.1.5)
activesupport (= 7.1.5)
actioncable (7.2.2)
actionpack (= 7.2.2)
activesupport (= 7.2.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.1.5)
actionpack (= 7.1.5)
activejob (= 7.1.5)
activerecord (= 7.1.5)
activestorage (= 7.1.5)
activesupport (= 7.1.5)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.5)
actionpack (= 7.1.5)
actionview (= 7.1.5)
activejob (= 7.1.5)
activesupport (= 7.1.5)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
actionmailbox (7.2.2)
actionpack (= 7.2.2)
activejob (= 7.2.2)
activerecord (= 7.2.2)
activestorage (= 7.2.2)
activesupport (= 7.2.2)
mail (>= 2.8.0)
actionmailer (7.2.2)
actionpack (= 7.2.2)
actionview (= 7.2.2)
activejob (= 7.2.2)
activesupport (= 7.2.2)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.1.5)
actionview (= 7.1.5)
activesupport (= 7.1.5)
actionpack (7.2.2)
actionview (= 7.2.2)
activesupport (= 7.2.2)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack (>= 2.2.4, < 3.2)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.5)
actionpack (= 7.1.5)
activerecord (= 7.1.5)
activestorage (= 7.1.5)
activesupport (= 7.1.5)
useragent (~> 0.16)
actiontext (7.2.2)
actionpack (= 7.2.2)
activerecord (= 7.2.2)
activestorage (= 7.2.2)
activesupport (= 7.2.2)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.1.5)
activesupport (= 7.1.5)
actionview (7.2.2)
activesupport (= 7.2.2)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.5)
activesupport (= 7.1.5)
activejob (7.2.2)
activesupport (= 7.2.2)
globalid (>= 0.3.6)
activemodel (7.1.5)
activesupport (= 7.1.5)
activerecord (7.1.5)
activemodel (= 7.1.5)
activesupport (= 7.1.5)
activemodel (7.2.2)
activesupport (= 7.2.2)
activerecord (7.2.2)
activemodel (= 7.2.2)
activesupport (= 7.2.2)
timeout (>= 0.4.0)
activestorage (7.1.5)
actionpack (= 7.1.5)
activejob (= 7.1.5)
activerecord (= 7.1.5)
activesupport (= 7.1.5)
activestorage (7.2.2)
actionpack (= 7.2.2)
activejob (= 7.2.2)
activerecord (= 7.2.2)
activesupport (= 7.2.2)
marcel (~> 1.0)
activesupport (7.1.5)
activesupport (7.2.2)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
securerandom (>= 0.3)
tzinfo (~> 2.0)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
api-pagination (6.0.0)
Expand Down Expand Up @@ -278,7 +272,6 @@ GEM
bigdecimal (~> 3.1)
mustermann (3.0.3)
ruby2_keywords (~> 0.0.1)
mutex_m (0.3.0)
net-imap (0.5.1)
date
net-protocol
Expand Down Expand Up @@ -336,20 +329,20 @@ GEM
rack-timeout (0.7.0)
rackup (2.2.1)
rack (>= 3)
rails (7.1.5)
actioncable (= 7.1.5)
actionmailbox (= 7.1.5)
actionmailer (= 7.1.5)
actionpack (= 7.1.5)
actiontext (= 7.1.5)
actionview (= 7.1.5)
activejob (= 7.1.5)
activemodel (= 7.1.5)
activerecord (= 7.1.5)
activestorage (= 7.1.5)
activesupport (= 7.1.5)
rails (7.2.2)
actioncable (= 7.2.2)
actionmailbox (= 7.2.2)
actionmailer (= 7.2.2)
actionpack (= 7.2.2)
actiontext (= 7.2.2)
actionview (= 7.2.2)
activejob (= 7.2.2)
activemodel (= 7.2.2)
activerecord (= 7.2.2)
activestorage (= 7.2.2)
activesupport (= 7.2.2)
bundler (>= 1.15.0)
railties (= 7.1.5)
railties (= 7.2.2)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -361,10 +354,10 @@ GEM
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.1.5)
actionpack (= 7.1.5)
activesupport (= 7.1.5)
irb
railties (7.2.2)
actionpack (= 7.2.2)
activesupport (= 7.2.2)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
Expand Down Expand Up @@ -526,6 +519,7 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
useragent (0.16.10)
webmock (3.24.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
Expand Down Expand Up @@ -590,7 +584,7 @@ DEPENDENCIES
rack-mini-profiler
rack-pratchett
rack-timeout (>= 0.6.0)
rails (~> 7.1.5)
rails (~> 7.2.2)
rails-controller-testing
rake (~> 13.2)
redcarpet (~> 3.6)
Expand Down
4 changes: 2 additions & 2 deletions app/concerns/concealable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ module Concealable
included do
# 3 used to be used as registered but was updated to full_accounts
# with the release of read-only accounts to avoid a db migration.
enum privacy: {
enum :privacy, {
public: 0,
private: 1,
access_list: 2,
full_accounts: 3, # registered accounts that are not read-only
registered: 4, # all registered accounts, both full and read-only
}, _prefix: true
}, prefix: true

def visible_to?(user)
# does not support access lists at this time
Expand Down
3 changes: 2 additions & 1 deletion app/concerns/orderable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def order=(val)
def reorder_others(is_after)
return unless destroyed? || order_change?(is_after)

if has_attribute?(:board_id) # all indexes are ordered
# Posts and BoardSections are ordered conditional on their board; all indexes are ordered
if has_attribute?(:board_id)
board_checking_id = is_after ? board_id_before_last_save : board_id_was
board_checking = Board.find_by_id(board_checking_id) || board
return unless board_checking.ordered?
Expand Down
3 changes: 3 additions & 0 deletions app/models/board_section.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class BoardSection < ApplicationRecord
private

def clear_section_ids
# if the parent board is already being destroyed, we'll handle this in board#move_posts_to_sandbox
# this avoids intermediate Post callbacks triggered by the section_id change that have no board present
return if destroyed_by_association&.active_record == Board
UpdateModelJob.perform_later(Post.to_s, { section_id: id }, { section_id: nil }, audited_user_id)
end

Expand Down
7 changes: 7 additions & 0 deletions bin/brakeman
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"

ARGV.unshift("--ensure-latest")

load Gem.bin_path("brakeman", "brakeman")
8 changes: 8 additions & 0 deletions bin/rubocop
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"

# explicit rubocop config increases performance slightly while avoiding config confusion.
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))

load Gem.bin_path("rubocop", "rubocop")
6 changes: 5 additions & 1 deletion bin/setup
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env ruby
require 'fileutils'

# path to your application root.
APP_ROOT = File.expand_path('..', __dir__)
APP_NAME = "glowfic"

def system!(*args)
system(*args, exception: true)
Expand Down Expand Up @@ -30,4 +30,8 @@ FileUtils.chdir APP_ROOT do

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"
end
11 changes: 9 additions & 2 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@
# :exception_recipients => %w{[email protected]}
# }

# Disable caching for Action Mailer templates even if Action Controller
# caching is enabled.
config.action_mailer.perform_caching = false

config.action_mailer.default_url_options = { host: "localhost", port: 3000 }

# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log

Expand All @@ -83,12 +87,12 @@
# config.i18n.raise_on_missing_translations = true

# Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true
config.action_view.annotate_rendered_view_with_filenames = true

# 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

# Check html is valid
Expand All @@ -101,4 +105,7 @@
# enable Resque logging
Resque.logger = Logger.new(STDOUT)
Resque.logger.level = Logger::INFO

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

0 comments on commit 3037925

Please sign in to comment.