Commit 2b5ac0a8 authored by Jonathan Schafer's avatar Jonathan Schafer

Fixed association between Finding, Finding Links

Changelog: fixed
EE: true
parent 6d377105
...@@ -4,7 +4,7 @@ module Vulnerabilities ...@@ -4,7 +4,7 @@ module Vulnerabilities
class FindingLink < ApplicationRecord class FindingLink < ApplicationRecord
self.table_name = 'vulnerability_finding_links' 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 :finding, presence: true
validates :url, presence: true, length: { maximum: 255 } validates :url, presence: true, length: { maximum: 255 }
......
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Vulnerabilities::FindingLink do RSpec.describe Vulnerabilities::FindingLink do
describe 'associations' 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_link) }
end end
describe 'validations' do 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