diff options
author | Go MAEDA <maeda@farend.jp> | 2023-10-29 11:45:56 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2023-10-29 11:45:56 +0000 |
commit | 67c268476ab38d7e1fa70ae02cd348da702a679a (patch) | |
tree | 0238c50e5e9ff76b14ffdadb70d8ab5d9e80066c /app/controllers | |
parent | a5092d8d0dae54739fba0ac7af3465aea8cd0496 (diff) | |
download | redmine-67c268476ab38d7e1fa70ae02cd348da702a679a.tar.gz redmine-67c268476ab38d7e1fa70ae02cd348da702a679a.zip |
Merged r22395 from trunk to 5.1-stable (#38493).
git-svn-id: https://svn.redmine.org/redmine/branches/5.1-stable@22396 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/issue_relations_controller.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/controllers/issue_relations_controller.rb b/app/controllers/issue_relations_controller.rb index 91297ac76..519cb9922 100644 --- a/app/controllers/issue_relations_controller.rb +++ b/app/controllers/issue_relations_controller.rb @@ -68,7 +68,7 @@ class IssueRelationsController < ApplicationController respond_to do |format| format.html {redirect_to issue_path(@issue)} format.js do - @relations = @issue.reload.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible?} + @relations = select_relations(@issue) @unsaved_relations = unsaved_relations end format.api do @@ -89,7 +89,10 @@ class IssueRelationsController < ApplicationController respond_to do |format| format.html {redirect_to issue_path(@relation.issue_from)} - format.js + format.js do + find_issue + @relations = select_relations(@issue) + end format.api {render_api_ok} end end @@ -123,4 +126,8 @@ class IssueRelationsController < ApplicationController # ToDo: Find a better method to return an error if the param is missing. [''] end + + def select_relations(issue) + issue.reload.relations.select {|r| r.other_issue(issue) && r.other_issue(issue).visible?} + end end |