From ece34149a29621cf65fc07d7e2855dca0d9ce1c2 Mon Sep 17 00:00:00 2001 From: Skud Date: Thu, 11 Jul 2013 22:15:56 +1000 Subject: [PATCH] need to test sunniness/planted_from.blank? --- app/models/crop.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/crop.rb b/app/models/crop.rb index 3574315f5..06b504274 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -46,7 +46,7 @@ class Crop < ActiveRecord::Base def sunniness sunniness = Hash.new(0) plantings.each do |p| - if p.sunniness + if !p.sunniness.blank? sunniness[p.sunniness] += 1 end end @@ -56,7 +56,7 @@ class Crop < ActiveRecord::Base def planted_from planted_from = Hash.new(0) plantings.each do |p| - if p.planted_from + if !p.planted_from.blank? planted_from[p.planted_from] += 1 end end