Skip to content

v5.28

Pre-release
Pre-release
Compare
Choose a tag to compare
@briri briri released this 19 Nov 20:25
· 8 commits to v5 since this release
deecfa0

Fixes #657, #658 and #659

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 to DmpRoadmap
  • Ran the rails app:update script tp let Rails 7 build its own version of all the bin/* files and the config/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 like VARIABLE_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 like serialize :option_list, Array so that they use named parameters like serialize :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 shorter Rails.configuration.x.[variableName] that happened within the config/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 in config/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] and organization.[variableName] to application_[variableName] and organization_[variableName]
    • update the config/dmproadmap.yaml file so that it contains all of the default variables that were previously defined in the config/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 became max_pages = Rails.configuration.x.dmproadmap.application_api_max_page_size
    • Update rack-attack config to be more restrictive for the contact us form