diff --git a/app/models/university/person/involvement.rb b/app/models/university/person/involvement.rb index 735c3f481730ad2d07b6d0df69966a2ae9c7ef87..988be24c96c7fa28a9a6eb6c18f87487d5db8a04 100644 --- a/app/models/university/person/involvement.rb +++ b/app/models/university/person/involvement.rb @@ -32,10 +32,6 @@ class University::Person::Involvement < ApplicationRecord belongs_to :person, class_name: 'University::Person' belongs_to :target, polymorphic: true - belongs_to :university_role, - -> { where(university_person_involvements: { target_type: 'University::Role' }) }, - class_name: "University::Role", - foreign_key: "target_id" validates :person_id, uniqueness: { scope: [:target_id, :target_type] } validates :target_id, uniqueness: { scope: [:person_id, :target_type] } diff --git a/app/views/admin/education/program/roles/_involvement_fields.html.erb b/app/views/admin/education/program/roles/_involvement_fields.html.erb index 3be0a41aae1b09623603ffbad83a0ac72f461a26..87b368af31776cb19491fafb7016abd173b4b051 100644 --- a/app/views/admin/education/program/roles/_involvement_fields.html.erb +++ b/app/views/admin/education/program/roles/_involvement_fields.html.erb @@ -6,7 +6,12 @@ <i class="fa fa-bars handle"></i> </div> <div class="col-9"> - <%= f.association :person, collection: @administration_people, label: false, include_blank: :translate, wrapper: false, required: true %> + <%= f.association :person, + collection: @administration_people, + label: false, + include_blank: :translate, + wrapper: false, + required: true %> </div> <div class="col-2"> <%= link_to_remove_association '<i class="fas fa-times"></i>'.html_safe, f, class: 'btn btn-sm btn-danger' %>