Change If statement to ternary operator [SCI-887]

This commit is contained in:
Oleksii Kriuchykhin 2017-01-18 13:42:11 +01:00
parent 50edaef4ff
commit 55d0e82fcd

View file

@ -70,11 +70,7 @@ class Experiment < ActiveRecord::Base
.where('experiments.project_id IN (?)', projects_ids)
.where_attributes_like([:name], a_query)
.limit(Constants::ATWHO_SEARCH_LIMIT)
if include_archived
return new_query
else
return new_query.is_archived(false)
end
return include_archived ? new_query : new_query.is_archived(false)
elsif include_archived
new_query =
Experiment