Version 15
Most impactful changes
- Redmine upgrade to version 6
- Hard switch to using Zeitwerk
- File structure and Transition
- Easy8 initialization process
Redmine 6 Upgrade
This document outlines the most impactful changes and deprecations introduced in the Redmine 6 upgrade. It is intended for developers and maintainers who need to understand the implications of these changes on their existing codebases.
Major Framework Upgrades
- ruby
>= 3.3.1→~> 3.4.0 - Added upper bound to Ruby version
- From version 15.6.0: Ruby
~> 4.0.1is required - For current version check platform_version file
- rails
~> 6.1.7.10→7.2.2.1 - Major framework upgrade
- rack
~> 2.2.3→>= 3.1.3
Breaking Changes
1. Aliasing Changes
Before:
After:
alias_attributeis now reserved for actual attributes- Use
alias_methodfor methods or non-attributes
2. Serialization Changes
Before:
After:
- Use
type:parameter instead of direct class - For complex objects, use
coder:parameter with a serializer class
3. ActiveSupport Deprecation Warnings
Before:
After:
- Changed from class method to instance method via the global deprecator
4. Asset Management
Before:
After:
- Removed plugin specification from asset helpers
- Asset paths must be properly registered in initializers:
Rails.application.configure do
asset_paths = EasyAssets.plugin_asset_paths("plugins/path/to/plugin")
config.assets.paths.concat asset_paths
config.assets.precompile << "your_asset.css"
end
5. Default Timezone Access
Before:
After:
- Default timezone now accessed through ActiveRecord instead of the class
6. Date/Time Formatting Changes
Before:
After:
- Changed from
to_s(:db)toto_fs(:db)for date/time formatting - This affects all date/time serialization to database format
- Check any code that formats dates for database queries or display
Warnings / Deprecations
Deprecated but not yet removed in Rails 7.2.
1. Enum Declaration Changes
Before:
enum state: %i[pending active], _prefix: true
enum status: { running: 0, archived: 1 }, _default: :running
After:
enum :state, %i[pending active], prefix: true
enum :status, { running: 0, archived: 1 }, default: :running
The enum syntax has changed significantly:
- First parameter is now a method name (
:statusinstead ofstatus:) - Removed underscore from some
enumoptions (prefix:,suffix:,default:instead of_prefix:,_suffix:,_default:)
Other important changes
1. Using Vite for JavaScript Asset Management
We are moving away from Sprockets and using Vite for JavaScript asset management. A new endpoint
app/frontend/entrypoints/easy_legacy_js.js has been created for legacy JavaScripts.
Before:
After:
- Move legacy JavaScript files to
app/frontend/src/easy_legacy_js/ - Import them in
app/frontend/entrypoints/easy_legacy_js.js
2. Inheriting ActiveRecord models from ApplicationRecord
All ActiveRecord models should now inherit from ApplicationRecord instead of ActiveRecord::Base.
Before:
After:
Recommendations for Upgrading
- Test thoroughly - The framework changes are substantial and require extensive testing
- Update dependencies - Update your gem dependencies to match the new requirements
- Refactor enums and serializers - These need immediate attention for compatibility
- Check asset loading - Ensure your assets are properly registered and loaded
- Update deprecation warnings - Replace deprecated calls with new methods
- Review database migrations - Ensure compatibility with the new database handling
- Consider Rails 7 compatibility - Review Rails 7 upgrade guide for additional changes not covered here