Allow chaining on Harvest predictions method returns

This commit is contained in:
Brenda Wallace committed 2019-11-24 10:30:56 +13:00
1 parent a8a522d09e
commit 554adf234e
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -72,7 +72,7 @@ module PredictHarvest
.where.not(planting_id: nil)
end
[]
Harvest.none
end
private
+1 -1
View File
@@ -104,7 +104,7 @@ class Planting < ApplicationRecord
end
def nearby_same_crop
return if location.empty?
return Planting.none if location.blank?
# latitude, longitude = Geocoder.coordinates(location, params: { limit: 1 })
Planting.joins(:garden)