Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt to base class changes in Redmine models #122

Merged

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants