Skip to content

Changes in version 15

Most impactful changes

Redmine 6 upgrade

These are the changes and deprecations that affect existing customisations.

Major framework upgrades

  • Ruby >= 3.3.1 โ†’ ~> 3.4.0 in version 15.0. From version 15.7, Ruby ~> 4.0.1 is required.
  • Rails ~> 6.1.7.10 โ†’ 7.2.2.1 in 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:

alias_attribute :host_name, :host

After:

alias_method :host_name, :host
  • alias_attribute is now reserved for actual attributes
  • Use alias_method for methods or non-attributes

2. Serialisation changes

Before:

serialize :settings, Hash
serialize :data, Array

After:

serialize :settings, type: Hash
serialize :data, coder: JSON
  • Use type: parameter instead of direct class
  • For complex objects, use coder: parameter with a serializer class

3. ActiveSupport deprecation warnings

Before:

ActiveSupport::Deprecation.warn("This method is deprecated")

After:

ActiveSupport.deprecator.warn("This method is deprecated")
  • Changed from class method to instance method via the global deprecator

4. Asset management

Before:

stylesheet_link_tag 'alerts', plugin: 'easy_alerts'

After:

stylesheet_link_tag 'alerts'
  • 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:

ActiveRecord::Base.default_timezone == :utc

After:

ActiveRecord.default_timezone == :utc
  • Default timezone now accessed through ActiveRecord instead of the class

6. Date/Time formatting changes

Before:

date_value.to_s(:db) # "2023-01-01"
time_value.to_s(:db) # "2023-01-01 12:34:56"

After:

date_value.to_fs(:db) # "2023-01-01"
time_value.to_fs(:db) # "2023-01-01 12:34:56"
  • Changed from to_s(:db) to to_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 (:status instead of status:)
  • Removed underscore from some enum options (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:

plugins/easyproject/easy_plugins/easy_extensions/assets/javascripts/context_menu.js

After:

app/frontend/src/easy_legacy_js/context_menu.js
// app/frontend/entrypoints/easy_legacy_js.js
import "../src/easy_legacy_js/context_menu";
  • 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:

class User < ActiveRecord::Base
  # ...
end

After:

class User < ApplicationRecord
  # ...
end

Recommendations for upgrading

  1. Test your customisations thoroughly.
  2. Update your gem dependencies to the new requirements.
  3. Refactor enums and serializers.
  4. Check that your assets are registered and load.
  5. Replace deprecated calls.
  6. Review your database migrations.
  7. Review the Rails 7 upgrade guide for changes not covered here.