diff --git a/docs/Major_releases/v15.md b/docs/Major_releases/v15.md new file mode 100644 index 0000000..8515639 --- /dev/null +++ b/docs/Major_releases/v15.md @@ -0,0 +1,176 @@ +# Version 15 + +## Most impactful changes + +- Redmine upgrade to version 6 +- Hard switch to using Zeitwerk + - [File structure and Transition](https://easysoftware.stoplight.io/docs/developer-portal-devs/c5d9cf64cd1e2-file-structure-and-transition) + - [Easy Project initialization process](https://easysoftware.stoplight.io/docs/developer-portal-devs/8e822d65a77a2-easy-project-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.3.7", "< 3.4.0"` + - Added upper bound to Ruby version +- 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:** + +```ruby +alias_attribute :host_name, :host +``` + +**After:** + +```ruby +alias_method :host_name, :host +``` + +- `alias_attribute` is now reserved for actual attributes +- Use `alias_method` for methods or non-attributes + +#### 2. Serialization Changes + +**Before:** + +```ruby +serialize :settings, Hash +serialize :data, Array +``` + +**After:** + +```ruby +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:** + +```ruby +ActiveSupport::Deprecation.warn("This method is deprecated") +``` + +**After:** + +```ruby +ActiveSupport.deprecator.warn("This method is deprecated") +``` + +- Changed from class method to instance method via the global deprecator + +#### 4. Asset Management + +**Before:** + +```ruby +stylesheet_link_tag 'alerts', plugin: 'easy_alerts' +``` + +**After:** + +```ruby +stylesheet_link_tag 'alerts' +``` + +- Removed plugin specification from asset helpers +- Asset paths must be properly registered in initializers: + +```ruby +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:** + +```ruby +ActiveRecord::Base.default_timezone == :utc +``` + +**After:** + +```ruby +ActiveRecord.default_timezone == :utc +``` + +- Default timezone now accessed through ActiveRecord instead of the class + +#### 6. Date/Time Formatting Changes + +**Before:** + +```ruby +date_value.to_s(:db) # "2023-01-01" +time_value.to_s(:db) # "2023-01-01 12:34:56" +``` + +**After:** + +```ruby +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 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:** + +```ruby +enum state: %i[pending active], _prefix: true +enum status: { running: 0, archived: 1 }, _default: :running +``` + +**After:** + +```ruby +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:`) + +### Recommendations for Upgrading + +1. **Test thoroughly** - The framework changes are substantial and require extensive testing +2. **Update dependencies** - Update your gem dependencies to match the new requirements +3. **Refactor enums and serializers** - These need immediate attention for compatibility +4. **Check asset loading** - Ensure your assets are properly registered and loaded +5. **Update deprecation warnings** - Replace deprecated calls with new methods +6. **Review database migrations** - Ensure compatibility with the new database handling +7. **Consider Rails 7 compatibility** - + Review [Rails 7 upgrade guide](https://guides.rubyonrails.org/v7.2/upgrading_ruby_on_rails.html) for additional + changes not covered here diff --git a/docs/Zeitwerk_support/File-structure-and-migration.md b/docs/Zeitwerk_support/File-structure-and-transition.md similarity index 100% rename from docs/Zeitwerk_support/File-structure-and-migration.md rename to docs/Zeitwerk_support/File-structure-and-transition.md diff --git a/toc.json b/toc.json index 765efa6..1ddda43 100644 --- a/toc.json +++ b/toc.json @@ -25,14 +25,23 @@ }, { "type": "item", - "title": "File structure and Migration", - "uri": "docs/Zeitwerk_support/File-structure-and-migration.md" + "title": "File structure and Transition", + "uri": "docs/Zeitwerk_support/File-structure-and-transition.md" }, { "type": "item", "title": "Easy Project initialization process with zeitwerk", "uri": "docs/Zeitwerk_support/Easy-Project-Initialization.md" }, + { + "type": "divider", + "title": "Major Releases" + }, + { + "type": "item", + "title": "Version 15", + "uri": "docs/Major_releases/v15.md" + }, { "type": "divider", "title": "Hello RYS"