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.
This commit is contained in:
Grzegorz Bizon 2019-01-29 14:40:47 +01:00
parent d434af46f4
commit 9f307421a7

View file

@ -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