Skip to content

Commit

Permalink
enforce hiding of concepts children if not in the scheme even if has …
Browse files Browse the repository at this point in the history
…children
  • Loading branch information
syphax-bouazzouni committed Nov 19, 2024
1 parent 674976e commit 8bb88d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/ontologies_linked_data/models/ontology_submission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -773,11 +773,11 @@ def children(cls, includes_param: [], concept_schemes: [], concept_collections:
end

unless concept_schemes.empty?
page_data.delete_if { |c| Array(c.isInActiveScheme).empty? && !c.load_has_children }
page_data.delete_if { |c| Array(c.isInActiveScheme).empty? }
if (page_data.size < size) && page_data.next_page
page_data += children(cls, includes_param: includes_param, concept_schemes: concept_schemes,
concept_collections: concept_collections,
page: page_data.next_page, size: size)
concept_collections: concept_collections,
page: page_data.next_page, size: size)
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/models/test_skos_submission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def test_children_of_scheme
refute_empty roots

roots = sub.children(cls, concept_schemes: concept_schemes, size: 10)
assert_equal 1, roots.size, 'Children should be filtered by the scheme in this case only one'
assert_equal 0, roots.size, 'Children should be filtered by the scheme'
end

end

0 comments on commit 8bb88d6

Please sign in to comment.