mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Remove unused method Enterprise::find_near
This commit is contained in:
@@ -176,17 +176,6 @@ class Enterprise < ActiveRecord::Base
|
||||
end
|
||||
}
|
||||
|
||||
def self.find_near(suburb)
|
||||
enterprises = []
|
||||
|
||||
unless suburb.nil?
|
||||
addresses = Spree::Address.near([suburb.latitude, suburb.longitude], ENTERPRISE_SEARCH_RADIUS, :units => :km).joins(:enterprise).limit(10)
|
||||
enterprises = addresses.collect(&:enterprise)
|
||||
end
|
||||
|
||||
enterprises
|
||||
end
|
||||
|
||||
# Force a distinct count to work around relation count issue https://github.com/rails/rails/issues/5554
|
||||
def self.distinct_count
|
||||
count(distinct: true)
|
||||
|
||||
Reference in New Issue
Block a user