mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-11 03:40:20 +00:00
Make this method handle the case where the variants hash passed is nil
This fixes a spec in the rails 4 branch
This commit is contained in:
@@ -184,6 +184,8 @@ module OpenFoodNetwork
|
||||
end
|
||||
|
||||
def variants_to_a(variants)
|
||||
return [] unless variants
|
||||
|
||||
variants.select { |_k, v| v }.keys.map(&:to_i)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user