Skip to content

Commit

Permalink
extract ignore_concept_param? helper
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Jul 22, 2023
1 parent ceec4fd commit 4b25bae
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,7 @@ def get_class(params)

if @ontology.flat?

ignore_concept_param = params[:conceptid].nil? ||
params[:conceptid].empty? ||
params[:conceptid].eql?("root") ||
params[:conceptid].eql?("bp_fake_root")
ignore_concept_param = ignore_concept_param?(params)
if ignore_concept_param
# Don't display any classes in the tree
@concept = LinkedData::Client::Models::Class.new
Expand Down Expand Up @@ -757,6 +754,14 @@ def submission_metadata
helper_method :submission_metadata

private

def ignore_concept_param?(params)
params[:conceptid].nil? ||
params[:conceptid].empty? ||
params[:conceptid].eql?("root") ||
params[:conceptid].eql?("bp_fake_root")
end

def not_found_record(exception)
@error_message = exception.message
render 'errors/not_found', status: 404
Expand Down

0 comments on commit 4b25bae

Please sign in to comment.