Upgrade to Rails 8 and Ruby 3.4.5 (#1)

* Bump Ruby to 3.4.5
* Update dependencies
* Adjust for Rails 8 and Ruby 3.5 API changes
* Mark params strings as mutable in prepapration for frozen strings in Ruby 3.5
* Update test for HTML5 sanitizer
    With Rails 7.1 the HTML5 sanitizer became the default, this breakts this test because the old sanitizer used to delete unpermitted nodes, while the new one returns their content
    The final string is safe, but different then it used to be in Rails 7.0
* Remove direct Turbo tesh helpers require & parallelize tests
* Fix Zeitwerk issues with rails extensions
* Update Resque setup for Redis 5+
* Remove unused views
* Remove GID v1 handler
This commit is contained in:
Stanko Krtalić
2025-09-02 17:02:41 +02:00
committed by GitHub
parent 657d4edcd4
commit eecdb29332
39 changed files with 508 additions and 417 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ class Membership < ApplicationRecord
after_destroy_commit { user.reset_remote_connections }
enum involvement: %w[ invisible nothing mentions everything ].index_by(&:itself), _prefix: :involved_in
enum :involvement, %w[ invisible nothing mentions everything ].index_by(&:itself), prefix: :involved_in
scope :with_ordered_room, -> { includes(:room).joins(:room).order("LOWER(rooms.name)") }
scope :without_direct_rooms, -> { joins(:room).where.not(room: { type: "Rooms::Direct" }) }
+3 -3
View File
@@ -53,12 +53,12 @@ class Opengraph::Fetch
# the body of any large responses. But that header could be wrong or
# missing. To be on the safe side, we'll read the body in chunks, and bail
# if it runs over our size limit.
"".tap do |body|
StringIO.new.tap do |body|
response.read_body do |chunk|
return nil if body.bytesize + chunk.bytesize > MAX_BODY_SIZE
return nil if body.string.bytesize + chunk.bytesize > MAX_BODY_SIZE
body << chunk
end
end
end.string
end
def response_valid?(response)
+1 -1
View File
@@ -2,7 +2,7 @@ module User::Role
extend ActiveSupport::Concern
included do
enum role: %i[ member administrator bot ]
enum :role, %i[ member administrator bot ]
end
def can_administer?(record = nil)
+1 -1
View File
@@ -53,7 +53,7 @@ class Webhook < ApplicationRecord
end
def extract_text_from(response)
response.body.force_encoding("UTF-8") if response.code == "200" && response.content_type.in?(%w[ text/html text/plain ])
response.body.dup.force_encoding("UTF-8") if response.code == "200" && response.content_type.in?(%w[ text/html text/plain ])
end
def receive_text_reply_to(room, text:)