From 1bbf0a3c18ec283a1331f18f4301dc0f6d290cd9 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 28 Apr 2018 22:11:02 +1200 Subject: [PATCH] Simplifying show_inactive_tickbox_path method --- app/helpers/application_helper.rb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7388445d5..ca4bc9429 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -67,16 +67,12 @@ module ApplicationHelper def show_inactive_tickbox_path(type, owner, show_all) all = show_all ? '' : 1 if owner - if type == 'plantings' - plantings_by_owner_path(owner: owner.slug, all: all) - elsif type == 'gardens' - gardens_by_owner_path(owner: owner.slug, all: all) - end - elsif type == 'plantings' - plantings_path(all: all) - elsif type == 'gardens' - gardens_path(all: all) + return plantings_by_owner_path(owner: owner.slug, all: all) if type == 'plantings' + return gardens_by_owner_path(owner: owner.slug, all: all) if type == 'gardens' end + + return plantings_path(all: all) if type == 'plantings' + return gardens_path(all: all) if type == 'gardens' end def title(type, owner, crop, planting)