v5.28
Pre-release
Pre-release
Upgrade to Rails 7.2!
Changes proposed in this PR:
- Upgrade to Rails 7.2 and Ruby 3.2
- Unpeg all gems that were specifying a specific version
- Update all gem and JS dependencies
- Update deprecated use of
@import
and$
variable references in all SASS files - Rails now uses Zeitwerk exclusively so class/module names matter. Needed to change the application name from
DMPRoadmap
toDmpRoadmap
- Ran the
rails app:update
script tp let Rails 7 build its own version of all thebin/*
files and theconfig/application.rb
,config/environments/*.rb
files and most initializers - Added font awesome woff and ttf files to the
app/assets/fonts
directory - Rails UJS changed a it so needed to update the way it is initialized in
application.js
- Rails ActiveRecord changed the way enums are handled (particularly when they are not mapped directly to a DB column). Needed to switch from
enum [variableName] { variableOne: 0, variableTwo: 1 }
format to using a constant likeVARIABLE_NAME = %w[variableOne variableTwo]
- ActiveRecord also changed the way field serializers are defined. They all now require a
coder
to be defined. So had to change all instances likeserialize :option_list, Array
so that they use named parameters likeserialize :option_list, type: Array, coder: JSON
- When calling
super
within a method you no longer need to pass the method's input variables directly - Rails changed the way it starts up and loads resources. Because of this, the mapping from
Rails.configuration.x.dmproadmap.[variableName]
to the shorterRails.configuration.x.[variableName]
that happened within theconfig/initializers/_dmproadmap.rb
was not happening. The AnywayConfig gem is still properly loading all variables, but the initializer file is now running before AnywayConfig so it was setting all variables to null or the default values defined inconfig/dmproadmap.yaml
. to correct this we needed to:- remove the old
config/initializers/_dmproadmap.rb
file since it is no longer useful - AnywayConfig cannot have nested variables, so flattened all
application.[variableName]
andorganization.[variableName]
toapplication_[variableName]
andorganization_[variableName]
- update the
config/dmproadmap.yaml
file so that it contains all of the default variables that were previously defined in theconfig/initializers/external_apis/*.rb
files. - update the AnywayConfig
config/configs/dmproadmap_config.rb
so that it now contains all variables (there were some that were defined within the old initializers. - updated ALL references to those variables. For example
max_pages = Rails.configuration.x.application.api_max_page_size
becamemax_pages = Rails.configuration.x.dmproadmap.application_api_max_page_size
- Update rack-attack config to be more restrictive for the contact us form
- remove the old