Skip to content
This repository was archived by the owner on Apr 10, 2023. It is now read-only.

Commit e036c72

Browse files
committed
Fix: remove controller_issues_new_after_save hook
controller_issues_new_after_save raises "ActiveRecord::StaleObjectError Attempted to update a stale object: Issue." in Rails 6.1. This exception can be suppressed by calling reload first, but the existence of this method seems unnecessary. Because it seems that after_save does not call reload from Redmine 4.0.
1 parent 88484de commit e036c72

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

lib/redmine_tags/hooks/model_issue_hook.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@ def controller_issues_bulk_edit_before_save(context = {})
99
bulk_update_tags_to_issues context
1010
end
1111

12-
# Issue has an after_save method that calls reload (update_nested_set_attributes)
13-
# This makes it impossible for a new record to get a tag_list, it's
14-
# cleared on reload. So instead, hook in after the Issue#save to update
15-
# this issue's tag_list and call #save ourselves.
16-
def controller_issues_new_after_save(context = {})
17-
save_tags_to_issue context, false
18-
context[:issue].save
19-
end
20-
2112
def save_tags_to_issue(context, create_journal)
2213
params = context[:params]
2314
issue = context[:issue]

0 commit comments

Comments
 (0)