mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-05 07:19:14 +00:00
When touching distributing enterprises, do not touch self -> infinite recursion
This commit is contained in:
@@ -467,6 +467,8 @@ class Enterprise < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def touch_distributors
|
||||
Enterprise.distributing_products(self.supplied_products).each(&:touch)
|
||||
Enterprise.distributing_products(self.supplied_products).
|
||||
where('enterprises.id != ?', self.id).
|
||||
each(&:touch)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user