Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spree 2 Upgrade] Restore Variant.on_hand methods #2575

Closed
mkllnk opened this issue Aug 23, 2018 · 0 comments
Closed

[Spree 2 Upgrade] Restore Variant.on_hand methods #2575

mkllnk opened this issue Aug 23, 2018 · 0 comments
Assignees

Comments

@mkllnk
Copy link
Member

mkllnk commented Aug 23, 2018

Description

Working on #2014 we found that we would like to restore the old Spree API to access and modify count_on_hand values. Even though that database column doesn't exist any more, we can pass all calls to the new default stock location.

Expected Behavior

OFN code can still use the following methods on Variant:

  • count_on_hand
  • count_on_hand=
  • on_hand
  • on_hand=

Actual Behavior

With Spree 2, these methods are gone and our calls fail.

Steps to Reproduce

The following specs fail explicitly because of on_hand methods missing. But a lot of them because of Spree::Product.on_hand, not Varaint.

./spec/controllers/admin/proxy_orders_controller_spec.rb
./spec/controllers/admin/subscriptions_controller_spec.rb
./spec/controllers/cart_controller_spec.rb
./spec/controllers/spree/admin/products_controller_spec.rb
./spec/controllers/spree/admin/variants_controller_spec.rb
./spec/controllers/spree/orders_controller_spec.rb
./spec/features/admin/adjustments_spec.rb
./spec/features/admin/bulk_product_update_spec.rb
./spec/features/admin/enterprises_spec.rb
./spec/features/admin/order_cycles_spec.rb
./spec/features/admin/orders_spec.rb
./spec/features/admin/product_import_spec.rb
./spec/features/admin/products_spec.rb
./spec/features/admin/reports_spec.rb
./spec/features/admin/variant_overrides_spec.rb
./spec/features/admin/variants_spec.rb
./spec/features/consumer/groups_spec.rb
./spec/features/consumer/producers_spec.rb
./spec/features/consumer/shopping/cart_spec.rb
./spec/features/consumer/shopping/checkout_auth_spec.rb
./spec/features/consumer/shopping/checkout_spec.rb
./spec/features/consumer/shopping/embedded_shopfronts_spec.rb
./spec/features/consumer/shopping/products_spec.rb
./spec/features/consumer/shopping/shopping_spec.rb
./spec/features/consumer/shopping/variant_overrides_spec.rb
./spec/features/consumer/shops_spec.rb
./spec/jobs/subscription_confirm_job_spec.rb
./spec/jobs/subscription_placement_job_spec.rb
./spec/lib/open_food_network/customers_report_spec.rb
./spec/lib/open_food_network/enterprise_fee_applicator_spec.rb
./spec/lib/open_food_network/enterprise_fee_calculator_spec.rb
./spec/lib/open_food_network/order_cycle_management_report_spec.rb
./spec/lib/open_food_network/order_cycle_permissions_spec.rb
./spec/lib/open_food_network/permissions_spec.rb
./spec/lib/open_food_network/products_and_inventory_report_spec.rb
./spec/lib/open_food_network/products_cache_spec.rb
./spec/lib/open_food_network/products_renderer_spec.rb
./spec/lib/open_food_network/scope_variants_to_search_spec.rb
./spec/lib/open_food_network/scope_variant_to_hub_spec.rb
./spec/lib/open_food_network/user_balance_calculator_spec.rb
./spec/models/cart_spec.rb
./spec/models/enterprise_caching_spec.rb
./spec/models/enterprise_fee_spec.rb
./spec/models/enterprise_spec.rb
./spec/models/exchange_spec.rb
./spec/models/order_cycle_spec.rb
./spec/models/producer_property_spec.rb
./spec/models/product_distribution_spec.rb
./spec/models/product_importer_spec.rb
./spec/models/spree/classification_spec.rb
./spec/models/spree/image_spec.rb
./spec/models/spree/line_item_spec.rb
./spec/models/spree/option_type_spec.rb
./spec/models/spree/order_spec.rb
./spec/models/spree/product_spec.rb
./spec/models/spree/property_spec.rb
./spec/models/spree/taxon_spec.rb
./spec/models/spree/variant_spec.rb
./spec/requests/shop_spec.rb
./spec/serializers/admin/for_order_cycle/enterprise_serializer_spec.rb
./spec/serializers/admin/for_order_cycle/supplied_product_serializer_spec.rb
./spec/serializers/spree/product_serializer_spec.rb
./spec/services/order_factory_spec.rb
./spec/services/order_syncer_spec.rb
./spec/services/subscription_form_spec.rb

Here are the non-feature specs with Variant.on_hand failing:

./spec/controllers/admin/proxy_orders_controller_spec.rb
./spec/controllers/admin/subscriptions_controller_spec.rb
./spec/controllers/cart_controller_spec.rb
./spec/controllers/spree/admin/products_controller_spec.rb
./spec/controllers/spree/admin/variants_controller_spec.rb
./spec/controllers/spree/orders_controller_spec.rb
./spec/jobs/subscription_confirm_job_spec.rb
./spec/jobs/subscription_placement_job_spec.rb
./spec/lib/open_food_network/products_renderer_spec.rb
./spec/lib/open_food_network/scope_variant_to_hub_spec.rb
./spec/models/cart_spec.rb
./spec/models/product_distribution_spec.rb
./spec/models/spree/line_item_spec.rb
./spec/services/order_factory_spec.rb
./spec/services/order_syncer_spec.rb
./spec/services/subscription_form_spec.rb
@luisramos0 luisramos0 changed the title [Spree upgrade] Restore Variant.on_hand methods [Spree 2 Upgrade] Restore Variant.on_hand methods Aug 24, 2018
@mkllnk mkllnk self-assigned this Aug 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants