Commit 05ea31d2 authored by James Fargher's avatar James Fargher

Merge branch...

Merge branch '330882-dependency-scanning-vulnerability-reports-a-lot-of-duplicate-links' into 'master'

Fix FindingLink Association

See merge request gitlab-org/gitlab!66103
parents eec90a86 6628cf63
......@@ -4,7 +4,7 @@ module Vulnerabilities
class FindingLink < ApplicationRecord
self.table_name = 'vulnerability_finding_links'
belongs_to :finding, class_name: 'Vulnerabilities::Finding', inverse_of: :finding_identifiers, foreign_key: 'vulnerability_occurrence_id'
belongs_to :finding, class_name: 'Vulnerabilities::Finding', inverse_of: :finding_links, foreign_key: 'vulnerability_occurrence_id'
validates :finding, presence: true
validates :url, presence: true, length: { maximum: 255 }
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Vulnerabilities::FindingLink do
describe 'associations' do
it { is_expected.to belong_to(:finding).class_name('Vulnerabilities::Finding') }
it { is_expected.to belong_to(:finding).class_name('Vulnerabilities::Finding').inverse_of(:finding_links) }
end
describe 'validations' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment