Skip to content

Conversation

@paranoicsan
Copy link
Collaborator

This pull request introduces a major update to the project, primarily upgrading Rails and Ruby versions, updating several gem dependencies, and making necessary compatibility adjustments throughout the codebase. It also includes improvements to model definitions, configuration files, and adds new configuration and migration files for Rails 7+ features. Below are the most important changes grouped by theme:

Framework and Dependency Upgrades

  • Upgraded Rails to version 7.2.2.1 and Ruby to 3.3.9, and updated multiple gem dependencies to ensure compatibility with Rails 7.2, including acts-as-taggable-on, devise, rack-mini-profiler, ransack, sprockets-rails, and others in both runtime and development groups. [1] [2] [3] [4] [5]
  • Added explicit rack dependency with version constraint to satisfy Rails 7.2.2.1 requirements.
  • Updated .ruby-version to 3.3.9 for local development consistency.

Codebase Modernization and Model Improvements

  • Updated enum usage in models to the new Rails 7 syntax (e.g., enum :role, { ... }), and replaced alias_attribute with alias where appropriate for better clarity and compatibility. [1] [2] [3] [4] [5] [6] [7] [8]
  • Adjusted serialization in Document model to use the new coder: keyword argument.
  • Improved robustness of several model methods to handle nil/blank cases and clarified comments. [1] [2] [3] [4]

Configuration and Environment Updates

  • Updated the dummy Rails application's configuration to use Rails 7.2 defaults, added a custom deprecation handler, and set up new configuration files for Rails 7 features such as cable.yml and storage.yml. [1] [2] [3]
  • Added a migration for ActiveStorage's service_name column to support Rails 7+ file storage.
  • Added a permissions policy initializer for HTTP permissions headers.

Testing and Linting Adjustments

  • Updated .rubocop.yml to exclude new paths and files, and configured style rules to avoid false positives on symbol arrays in gemspec and Gemfile. [1] [2]
  • Adjusted test environment configuration for Rails 7, including exception handling and logging. [1] [2]

Other Improvements

  • Required sprockets/railtie in the engine to ensure asset pipeline compatibility with Rails 7.
  • Switched from byebug to debug gem for modern debugging support in development and test environments.

These changes collectively modernize the codebase for Rails 7.2, improve maintainability, and ensure compatibility with updated dependencies.

@paranoicsan paranoicsan requested a review from shlag3n August 6, 2025 03:18
@paranoicsan paranoicsan self-assigned this Aug 6, 2025
@paranoicsan paranoicsan added dependencies Pull requests that update a dependency file ruby Pull requests that update Ruby code labels Aug 6, 2025
Changes made:
- Changed spec/dummy/.ruby-version to match the required Ruby version
- Updated spec/dummy/config/application.rb for Rails 7.2 compatibility
- Adjusted spec/dummy/config/environments/test.rb for improved test configuration
- Added spec/dummy/lib/custom_deprecation_handler.rb for custom deprecation handling
- Modified spec/support/database_cleaner.rb to support a new gem version

Updated gems:
- acts-as-taggable-on (~> 12.0) (was ~> 9.0)
- devise (~> 4.9) (was ~> 4.7)
- rails (~> 7.1.5) (was ~> 7.0)
- ransack (~> 4.2.1) (was ~> 2.3)
- database_cleaner-active_record (~> 2.2) (was ~> 1.8)
- factory_bot (~> 6.5) (was ~> 5)
- rspec-rails (~> 7.1) (was ~> 4.0.2)
Bellow is a code snippet:

```log
DEPRECATION WARNING: Lcms::Engine::Resource model aliases `resource_reading_assignments`, but `resource_reading_assignments` is not an attribute. Starting in Rails 7.2, alias_attribute with non-attribute targets will raise. Use `alias_method :reading_assignments, :resource_reading_assignments` or define the method manually. (called from block (3 levels) in <top (required)> at /app/spec/controllers/units_controller_spec.rb:15)
```
Bellow is a code snippet:

```log
DEPRECATION WARNING: Passing the coder as positional argument is deprecated and will be removed in Rails 7.2.
```
Changes made:
- Switched to Rails 7.2.2.1 and updated related dependencies in gemspec and Gemfile.lock
- Added explicit rack (< 3.2) dependency for compatibility with Rails 7.2
- Updated sprockets-rails to '~> 3.5', rack-mini-profiler to '~> 4.0.1'
- Added debug gem for development and test environments
- Updated .rubocop.yml to exclude new dummy config/migrate/bin files and adjust Style/SymbolArray
- Added/updated test/dummy files: cable.yml, storage.yml, permissions_policy.rb, public assets, and ActiveStorage migrations
- Added bin/rubocop to dummy app
- Updated Docker Compose config
- Refactored and updated app/models/lcms/engine/document.rb, lib/lcms/engine/engine.rb, and spec/services/document_build_service_spec.rb for compatibility and improvements
- Updated test environment configs for Rails 7.2

Explicitly changed gems in gemspec:
- rails (~> 7.2.2, >= 7.2.2.1)
- rack (< 3.2)
- sprockets-rails (~> 3.5, >= 3.5.2)
- rack-mini-profiler (~> 4.0.1)
- debug (development)
Bellow is a code snippet:

```log
DEPRECATION WARNING: Defining enums with keyword arguments is deprecated and will be removed
in Rails 8.0.
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file ruby Pull requests that update Ruby code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants