mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-31 06:31:41 +00:00
Merge branch 'master' into 2-0-stable-dec-10th
This commit is contained in:
@@ -1,18 +1,9 @@
|
||||
module OpenFoodNetwork
|
||||
class PropertyMerge
|
||||
def self.merge(primary, secondary)
|
||||
primary + secondary.reject do |secondary_p|
|
||||
primary.any? do |primary_p|
|
||||
property_of(primary_p).presentation == property_of(secondary_p).presentation
|
||||
end
|
||||
(primary + secondary).uniq do |property_object|
|
||||
property_object.property.presentation
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
|
||||
def self.property_of(p)
|
||||
p.respond_to?(:property) ? p.property : p
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user