From 9f307421a7c6f18a9879598e107f9e36456abd83 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Tue, 29 Jan 2019 14:40:47 +0100 Subject: [PATCH] Simplify relation between a build and metadata This removes erroneously defined polymorphic association, because specifying `belongs_to` relationship with a class that already supports polymorphic associations works out-of-the-box. --- app/models/ci/build_metadata.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/models/ci/build_metadata.rb b/app/models/ci/build_metadata.rb index 06e4584863d..cd8eb774cf5 100644 --- a/app/models/ci/build_metadata.rb +++ b/app/models/ci/build_metadata.rb @@ -10,9 +10,7 @@ module Ci self.table_name = 'ci_builds_metadata' - belongs_to :build, class_name: 'CommitStatus', - polymorphic: true, # rubocop:disable Cop/PolymorphicAssociations - inverse_of: :metadata + belongs_to :build, class_name: 'CommitStatus' belongs_to :project before_create :set_build_project