Skip to content

Commit

Permalink
handle exception for class attribute but aren't in populate_from_params
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Jul 31, 2023
1 parent 070b1fb commit f0da26e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ def populate_from_params(obj, params)
value = is_arr ? value : [value]
new_value = []
value.each do |cls|
if uri_as_needed(cls["ontology"]).nil?
new_value << cls
next
end
sub = LinkedData::Models::Ontology.find(uri_as_needed(cls["ontology"])).first.latest_submission
new_value << LinkedData::Models::Class.find(cls["class"]).in(sub).first
end
Expand Down

0 comments on commit f0da26e

Please sign in to comment.