diff --git a/lib/seek/json_metadata/attribute.rb b/lib/seek/json_metadata/attribute.rb index ff03848100..388d2155fc 100644 --- a/lib/seek/json_metadata/attribute.rb +++ b/lib/seek/json_metadata/attribute.rb @@ -78,9 +78,9 @@ def linked_sample_type_and_attribute_type_consistency if sample_attribute_type && linked_sample_type && !seek_sample? && !seek_sample_multi? errors.add(:sample_attribute_type, 'Attribute type must be SeekSample if linked sample type set') end - if seek_sample? && linked_sample_type.nil? && !is_isa_compliant_input? + if seek_sample? && linked_sample_type.nil? && !is_isa_compliant_template_input? errors.add(:seek_sample, 'Linked Sample Type must be set if attribute type is Registered Sample') - elsif seek_sample_multi? && linked_sample_type.nil? && !is_isa_compliant_input? + elsif seek_sample_multi? && linked_sample_type.nil? && !is_isa_compliant_template_input? errors.add(:seek_sample_multi, 'Linked Sample Type must be set if attribute type is Registered Sample List') end end @@ -94,12 +94,10 @@ def check_value_against_base_type(value) base_type_handler.validate_value?(value) end - def is_isa_compliant_input? - if is_a?(SampleAttribute) - input_attribute? && sample_type.is_isa_json_compliant? - else - input_attribute? - end + def is_isa_compliant_template_input? + return input_attribute? if is_a?(TemplateAttribute) + + false end end end