Changes in version 15¶
Most impactful changes¶
- Redmine upgrade to version 6
- Hard switch to using Zeitwerk
- File structure and Transition
- Easy8 initialisation order
Redmine 6 upgrade¶
These are the changes and deprecations that affect existing customisations.
Major framework upgrades¶
- Ruby
>= 3.3.1โ~> 3.4.0in version 15.0. From version 15.7, Ruby~> 4.0.1is required. - Rails
~> 6.1.7.10โ7.2.2.1in version 15.0. Later 15.x releases use Rails~> 8.1. - Rack
~> 2.2.3โ>= 3.1.3
The Rails 7.2 examples below stay valid on Rails 8.1.
Breaking changes¶
1. Aliasing changes¶
Before:
After:
alias_attributeis now reserved for actual attributes- Use
alias_methodfor methods or non-attributes
2. Serialisation 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 serialisation 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¶
JavaScript assets moved from Sprockets to Vite. Legacy scripts load through the entrypoint
app/frontend/entrypoints/easy_legacy_js.js.
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 your customisations thoroughly.
- Update your gem dependencies to the new requirements.
- Refactor enums and serializers.
- Check that your assets are registered and load.
- Replace deprecated calls.
- Review your database migrations.
- Review the Rails 7 upgrade guide for changes not covered here.