From 55d0e82fcd9a266bbc7afc8849762d85a1fa0b0d Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Wed, 18 Jan 2017 13:42:11 +0100 Subject: [PATCH] Change If statement to ternary operator [SCI-887] --- app/models/experiment.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/models/experiment.rb b/app/models/experiment.rb index 2e018c077..8b0735a18 100644 --- a/app/models/experiment.rb +++ b/app/models/experiment.rb @@ -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