Skip to content

Commit

Permalink
Don't take into account sample attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
kdp-cloud committed Mar 15, 2024
1 parent 0a479c0 commit b2a8389
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/seek/json_metadata/attribute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit b2a8389

Please sign in to comment.