mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-31 21:37:16 +00:00
Comment proxy classes
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
module OpenFoodNetwork
|
||||
# Variants can have several fields overridden on a per-enterprise basis by the
|
||||
# VariantOverride model. These overrides can be applied to variants by wrapping their
|
||||
# products in this proxy, which wraps the product's variants in VariantProxy.
|
||||
class ProductProxy
|
||||
instance_methods.each { |m| undef_method m unless m =~ /(^__|^send$|^object_id$)/ }
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
module OpenFoodNetwork
|
||||
# Variants can have several fields overridden on a per-enterprise basis by the
|
||||
# VariantOverride model. These overrides can be applied to variants by wrapping in an
|
||||
# instance of the VariantProxy class. This class proxies most methods back to the wrapped
|
||||
# variant, but checks for overrides when fetching some properties.
|
||||
class VariantProxy
|
||||
instance_methods.each { |m| undef_method m unless m =~ /(^__|^send$|^object_id$)/ }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user