My goal is to propagate the deletion of an issue to change a custom field of the linked issue. So, I intercept the destruction of an issue.
I’m encountering a problem in my redmine plugin. IssueRelation are not accessible as expected when calling the before_destroy
hook in issue model.
Context :
Redmine version 5.0.5.devel and 5.1.2.stable
Ruby version 2.7.4-p191 (2021-07-07) [x86_64-linux-gnu] / 3.2.4-p170 (2024-04-23) [x86_64-linux]
Rails version 6.1.7.4
what I mean is that for the same function. for example Rails.logger.info(IssueRelation.all.inspect).
if I run it with the after_save
, before_save
hook and some relationships exist I’ll see them but when I’m in a before_destroy
or after_destroy
hook the result of IssueRelation.all
is empty
I also tried in the IssueRelation model; however, when an Issue is destroyed, it seems that it does not pass through IssueRelation#destroy to remove the relation from the database.
Is this a known and unsolvable problem due to the framework’s architecture, or am I just handling it very poorly?
Thank you in advance for your help.
Ctrl Maj Sup is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.