From f86177e78fb8a214fa7df500112fdb00eab07f95 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 20 Apr 2019 15:10:08 +1200 Subject: [PATCH] lint --- app/helpers/harvests_helper.rb | 2 +- app/helpers/seeds_helper.rb | 6 +++--- spec/views/plantings/show.html.haml_spec.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/helpers/harvests_helper.rb b/app/helpers/harvests_helper.rb index 740f99423..ff1838ce4 100644 --- a/app/helpers/harvests_helper.rb +++ b/app/helpers/harvests_helper.rb @@ -11,7 +11,7 @@ module HarvestsHelper end def display_human_quantity(harvest) - return unless harvest.quantity.present? && harvest.quantity > 0 + return unless harvest.quantity.present? && harvest.quantity > 0 if harvest.unit == 'individual' # just the number number_to_human(harvest.quantity, strip_insignificant_zeros: true) diff --git a/app/helpers/seeds_helper.rb b/app/helpers/seeds_helper.rb index 5ae960b87..2715fedca 100644 --- a/app/helpers/seeds_helper.rb +++ b/app/helpers/seeds_helper.rb @@ -9,9 +9,9 @@ module SeedsHelper def display_seed_description(seed) if seed.description.present? - truncate(seed.description, length: 130, separator: ' ', omission: '... ') { link_to "Read more", seed_path(seed) } - else - '' + return truncate(seed.description, length: 130, separator: ' ', omission: '... ') { link_to "Read more", seed_path(seed) } end + + '' end end diff --git a/spec/views/plantings/show.html.haml_spec.rb b/spec/views/plantings/show.html.haml_spec.rb index 5c976a10f..97f58e940 100644 --- a/spec/views/plantings/show.html.haml_spec.rb +++ b/spec/views/plantings/show.html.haml_spec.rb @@ -86,7 +86,7 @@ describe "plantings/show" do end it "shows the member's location in parentheses" do - expect(rendered).to have_content "#{planting.owner.location}" + expect(rendered).to have_content planting.owner.location.to_s end end end