Skip to content

Commit

Permalink
Raise error if linking method is not in approved linking methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kdp-cloud committed Sep 9, 2024
1 parent 2b51066 commit 430ff39
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/samples_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ def find_index_assets
# @param template_attribute_title [String] the title of the template attribute to filter by
# @return [Array<Sample>] the filtered list of samples
def filter_linked_samples(samples, link, options, template_attribute)
raise ArgumentError, "Invalid linking method provided. '#{link.to_s}' is not allowed!" unless %i[linked_samples linking_samples].include? link

template_attribute_title = template_attribute&.title
samples.select do |s|
s.send(link).any? do |x|
Expand Down

0 comments on commit 430ff39

Please sign in to comment.