@@ -22,13 +22,13 @@ class Submission < ApplicationRecord
2222
2323 belongs_to :external_users , lambda {
2424 where ( submissions : { contributor_type : 'ExternalUser' } ) . includes ( :submissions )
25- } , foreign_key : :contributor_id , class_name : 'ExternalUser' , optional : true
25+ } , foreign_key : :contributor_id , class_name : 'ExternalUser' , optional : true , inverse_of : :submissions
2626 belongs_to :internal_users , lambda {
2727 where ( submissions : { contributor_type : 'InternalUser' } ) . includes ( :submissions )
28- } , foreign_key : :contributor_id , class_name : 'InternalUser' , optional : true
28+ } , foreign_key : :contributor_id , class_name : 'InternalUser' , optional : true , inverse_of : :submissions
2929 belongs_to :programming_groups , lambda {
3030 where ( submissions : { contributor_type : 'ProgrammingGroup' } ) . includes ( :submissions )
31- } , foreign_key : :contributor_id , class_name : 'ProgrammingGroup' , optional : true
31+ } , foreign_key : :contributor_id , class_name : 'ProgrammingGroup' , optional : true , inverse_of : :submissions
3232 delegate :execution_environment , to : :exercise
3333
3434 scope :final , -> { where ( cause : %w[ submit remoteSubmit ] ) }
0 commit comments