Skip to content

Commit

Permalink
chore: Update Ruby 3 and Rails 7 (#994)
Browse files Browse the repository at this point in the history
* Update to Ruby 3.0

* [6.1 defaults] enable has_many_inversing

* [6.1 defaults] enable track_variants

* [6.1 defaults] cookies_same_site_protection = :lax

* [6.1 defaults] enable urlsafe_csrf_tokens

* [6.1 defaults] enable utc_to_local_returns_utc_offset_times

* [6.1 defaults] enable ssl_default_redirect_status=308

* [6.1 defaults] disable legacy_connection_handling

* [6.1 defaults] enable preload_links_header

* Load Rails 6.1 defaults

* Clean up active storage disc files after test suite is complete

* Upgrade to Rails 7.0.0

* Fix deprecation: image/jpg is not a valid content type

* GREEN test prior to removing config.active_storage.replace_on_assign_to_many

* Fix deprecation: config.active_storage.replace_on_assign_to_many is deprecated and will be removed in Rails 7.1

* [7.0 defaults] button_to_generates_button_tag=true

* [7.0 defaults] video_preview_arguments uses scene detection

* Use libvips instead of imagemagic package

* [7.0 defaults] variant_processor = :vips

* [7.0 defaults] REMOVES cookie serializer since we set it elsewhere

* [7.0 defaults] Enables wrap_parameters_by_default and removes redundant initializer

* [7.0 defaults] Removes legacy style sheet media tag

* [7.0 defaults] Updates default headers for XSS protection

* [7.0 defaults] Enable open redirect protection

* [7.0 defaults] Enable foreign key verification for text fixtures

* [7.0 defaults] Enable executor wrap around test cases

* [7.0 defaults] Use default thread isolation

* [7.0 defaults] Use default smtp timeout (irrelevant since we don't send emails

* [7.0 defaults] Enable automatic_scope_inversing

* [7.0 defaults] Disable partial inserts on ActiveRecord

* [7.0 defaults] use_rfc4122_namespaced_uuids (irrelevants since we don't use uuids)

* Fix deprecation: webconsole.whitelisted_ips to allowed_ips

---------

Co-authored-by: Laura Mosher <lauramosher@users.noreply.github.com>
  • Loading branch information
lauramosher and lauramosher committed Apr 12, 2024
1 parent 5abcfb6 commit 18c105b
Show file tree
Hide file tree
Showing 44 changed files with 380 additions and 370 deletions.
8 changes: 4 additions & 4 deletions rails/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# == Development Image
#
# Also used as the base for building assets for prod images.
FROM ruby:2.7.8-alpine as devcore
FROM ruby:3.0-alpine3.16 as devcore

RUN apk --no-cache add --update \
build-base \
Expand All @@ -25,7 +25,7 @@ RUN apk --no-cache add --update \
libxml2-dev \
libxslt-dev \
libc6-compat \
imagemagick \
vips \
ffmpeg \
poppler && \
gem install bundler --no-document --force -v '~> 2.4.7'
Expand All @@ -51,7 +51,7 @@ RUN bin/rake assets:precompile
#
# Start from base Ruby image so we can keep image size slim
# Final image can be used for online or offline mode.
FROM ruby:2.7.8-alpine as prod
FROM ruby:3.0-alpine3.16 as prod

EXPOSE 3000

Expand All @@ -67,7 +67,7 @@ RUN apk --no-cache add \
libxml2 \
libxslt \
libc6-compat \
imagemagick \
vips \
ffmpeg \
poppler && \
gem install bundler --no-document --force
Expand Down
12 changes: 6 additions & 6 deletions rails/Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.7.8'
ruby '3.0.6'

# lock mail version (required by rails)
# until upgrade to Ruby 3 / Rails 7
gem 'mail', '2.7.1'
gem 'rails', '~> 6.1.0'
gem 'rails', '7.0.0'

# No longer included in rails as of 7.0
gem "sprockets-rails"

# Use Puma as the app server
gem 'puma', '< 7'
Expand Down Expand Up @@ -49,7 +49,7 @@ gem 'aws-sdk-s3', '~> 1.119.0'
gem 'active_storage_validations', '~> 1.0'

# Enable Webpack for javascript application code
gem 'shakapacker', '~> 7.1'
gem 'shakapacker', '7.1.0'
gem 'react-rails', '~> 2.6.2'

# Use ActiveStorage variant
Expand Down
Loading

0 comments on commit 18c105b

Please sign in to comment.