Skip to content

Commit

Permalink
Extracted Node visibility check into Node.visible? method. Updated it…
Browse files Browse the repository at this point in the history
… to accept role names as symbols
  • Loading branch information
damisul committed Aug 8, 2024
1 parent a1aef11 commit 85e4f82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/services/generate_toc_tree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def add_child(child, seqno)

# Checks if given Node should be displayed in TOC tree for given authority and role combination
def visible?(role, authority_id)
if item.involved_authorities.any? { |ia| ia.role == role && ia.authority_id == authority_id }
if item.involved_authorities.any? { |ia| ia.role == role.to_s && ia.authority_id == authority_id }
# authority is specified on collection level with given role
true
else
Expand Down

0 comments on commit 85e4f82

Please sign in to comment.