mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-18 21:56:55 -04:00
Make calc_and_set_days_before_maturity public
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user