Merge branch 'master' into 2-0-stable-dec-10th

This commit is contained in:
luisramos0
2018-12-10 16:41:29 +00:00
31 changed files with 488 additions and 289 deletions

View File

@@ -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