mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-14 23:47:48 +00:00
Merge pull request #13414 from mkllnk/remove-unused-hub
Remove unused instance variable
This commit is contained in:
@@ -3,15 +3,14 @@
|
||||
module OpenFoodNetwork
|
||||
class ScopeVariantToHub
|
||||
def initialize(hub, variant_overrides = nil)
|
||||
@hub = hub
|
||||
@variant_overrides = variant_overrides || VariantOverride.indexed(@hub)
|
||||
@variant_overrides = variant_overrides || VariantOverride.indexed(hub)
|
||||
@inventory_enabled = OpenFoodNetwork::FeatureToggle.enabled?(:inventory, hub)
|
||||
end
|
||||
|
||||
def scope(variant)
|
||||
return unless OpenFoodNetwork::FeatureToggle.enabled?(:inventory, @hub)
|
||||
return unless @inventory_enabled
|
||||
|
||||
variant.extend(OpenFoodNetwork::ScopeVariantToHub::ScopeVariantToHub)
|
||||
variant.instance_variable_set :@hub, @hub
|
||||
variant.instance_variable_set :@variant_override, @variant_overrides[variant]
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user