Patch #27695 ยป 0001-Handle-validation-errors-on-reverse-issue-relations.patch
app/controllers/issue_relations_controller.rb | ||
---|---|---|
46 | 46 |
@relation.issue_from = @issue |
47 | 47 |
@relation.safe_attributes = params[:relation] |
48 | 48 |
@relation.init_journals(User.current) |
49 |
saved = @relation.save |
|
49 | ||
50 |
begin |
|
51 |
saved = @relation.save |
|
52 |
rescue ActiveRecord::RecordNotUnique |
|
53 |
saved = false |
|
54 |
@relation.errors.add :base, :taken |
|
55 |
end |
|
50 | 56 | |
51 | 57 |
respond_to do |format| |
52 | 58 |
format.html { redirect_to issue_path(@issue) } |