Adapt to base class changes in Redmine models #122
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation / Background
Due to changes in Redmine issue #38975, the base class for models in Redmine has been changed from
ActiveRecord::Base
toApplicationRecord
. 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 inApplicationRecord
(code) , continuing to inherit fromActiveRecord::Base
may alter the behavior of this method. Furthermore, this would prevent following any future changes or additions toApplicationRecord
.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 bothApplicationRecord
andActiveRecord::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: