Skip to content

Conversation

hidakatsuya
Copy link
Contributor

@hidakatsuya hidakatsuya commented Apr 26, 2024

Motivation / Background

Due to changes in Redmine issue #38975, the base class for models in Redmine has been changed from ActiveRecord::Base to ApplicationRecord. Currently, this change is included in the roadmap for Redmine 6.

This plugin does not use methods such as acts_as_positioned which Redmine adds to ApplicationRecord, so it is unlikely unaffected by this change. In fact, I have verified that the plugin operates correctly with Redmine trunk(r22787).

However, since Redmine has overriden and modified the human_attribute_name method in ApplicationRecord (code) , continuing to inherit from ActiveRecord::Base may alter the behavior of this method. Furthermore, this would prevent following any future changes or additions to ApplicationRecord.

For more detailed information about this change, you might find the following article helpful (In Japanese):
https://blog.redmine.jp/articles/6_0/checklist-themes-plugins-developer-before-redmine-6/

Detail

Given the above, this pull request proposes modifying the inheritance for the ViewCustomize model to support both ApplicationRecord and ActiveRecord::Base. This change will maintain compatibility with Redmine 5 while facilitating a transition to Redmine 6.

Additional Information

I have manually confirmed the ability to insert HTML into the header section in the following environments:

  • Redmine trunk (r22787) + Ruby 3.3.0
  • Redmine v5.1 + Ruby 3.2.3
@hidakatsuya hidakatsuya changed the title Adapt to base class changes in Redmine models Adapting to the Change in Base Model Class in Redmine Apr 26, 2024
@hidakatsuya hidakatsuya changed the title Adapting to the Change in Base Model Class in Redmine Adapt to base class changes in Redmine models Apr 26, 2024
@onozaty
Copy link
Owner

onozaty commented May 6, 2024

Thank you very much!
I am busy right now and can't take the time, but I will check back later.

@onozaty onozaty changed the base branch from master to develop/v3.5.2 May 18, 2024 03:47
@onozaty onozaty merged commit 62edb35 into onozaty:develop/v3.5.2 May 18, 2024
@onozaty
Copy link
Owner

onozaty commented May 18, 2024

Released at v3.5.2.
Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants