Make calc_and_set_days_before_maturity public

This commit is contained in:
Brenda Wallace
2017-04-27 20:06:44 +12:00
committed by Shiny
parent 0e71a4fcb3
commit ccc5eb3c9a

View File

@@ -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