From 7e7429446d58291822658e058eaf69bc41a760e9 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Fri, 27 Sep 2019 17:28:16 +0100 Subject: [PATCH] Remove deprecation warnings from VariantStock methods --- app/models/concerns/variant_stock.rb | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/app/models/concerns/variant_stock.rb b/app/models/concerns/variant_stock.rb index b859b825fa..150d8d05c3 100644 --- a/app/models/concerns/variant_stock.rb +++ b/app/models/concerns/variant_stock.rb @@ -25,8 +25,6 @@ module VariantStock # # @return [Float|Integer] def on_hand - warn_deprecation(__method__, '#total_on_hand') - total_on_hand end @@ -37,8 +35,6 @@ module VariantStock # @raise [StandardError] when the track_inventory_levels config key is not set # and when the variant has no stock item def on_hand=(new_level) - warn_deprecation(__method__, '#total_on_hand') - error = 'Cannot set on_hand value when Spree::Config[:track_inventory_levels] is false' raise error unless Spree::Config.track_inventory_levels @@ -53,8 +49,6 @@ module VariantStock # track_inventory_levels only. It was initially introduced in # https://github.com/openfoodfoundation/spree/commit/20b5ad9835dca7f41a40ad16c7b45f987eea6dcc def on_demand - warn_deprecation(__method__, 'StockItem#backorderable?') - # A variant that has not been saved yet, doesn't have a stock item # This provides a default value for variant.on_demand using Spree::StockLocation.backorderable_default return Spree::StockLocation.first.backorderable_default if stock_items.empty? @@ -69,8 +63,6 @@ module VariantStock # # @raise [StandardError] when the variant has no stock item yet def on_demand=(new_value) - warn_deprecation(__method__, 'StockItem#backorderable=') - raise_error_if_no_stock_item_available # There should be only one at the default stock location. @@ -158,11 +150,4 @@ module VariantStock def stock_item stock_items.first end - - def warn_deprecation(method_name, new_method_name) - ActiveSupport::Deprecation.warn( - "`##{method_name}` is deprecated and will be removed. " \ - "Please use `#{new_method_name}` instead." - ) - end end