mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-21 05:09:15 +00:00
Load actual variants in the exchange, wrong behaviour was implemented in previous two commits
This commit is contained in:
@@ -4,9 +4,6 @@ class Api::Admin::ExchangeSerializer < ActiveModel::Serializer
|
||||
has_many :enterprise_fees, serializer: Api::Admin::EnterpriseFeeSerializer
|
||||
|
||||
def variants
|
||||
Hash[
|
||||
OpenFoodNetwork::Permissions.new(options[:current_user]).
|
||||
visible_variants_within(object).map { |v| [v.id, true] }
|
||||
]
|
||||
Hash[ object.variants.map { |v| [v.id, true] } ]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user