From ccc5eb3c9a18204bd905bc680aad154af155f008 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 27 Apr 2017 20:06:44 +1200 Subject: [PATCH] Make calc_and_set_days_before_maturity public --- app/models/planting.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/planting.rb b/app/models/planting.rb index 7d323c020..bba62f61e 100644 --- a/app/models/planting.rb +++ b/app/models/planting.rb @@ -133,8 +133,6 @@ class Planting < ActiveRecord::Base differences.compact.sum / differences.compact.size unless differences.compact.empty? end - private - def calc_and_set_days_before_maturity # calculate the number of days, from planted_at, until maturity if planted_at && finished_at @@ -144,6 +142,8 @@ class Planting < ActiveRecord::Base end end + private + def other_finished_plantings_same_crop Planting.where(crop_id: crop).where.not(id: id).where.not(finished_at: nil) end