From 52b43d8c233d1e163f644ac9ec53eb5b10c33513 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Thu, 7 Jan 2021 16:03:04 +0000 Subject: [PATCH] Delete dead code This method isn't called from anywhere --- app/models/spree/product.rb | 4 ---- spec/models/spree/product_spec.rb | 15 --------------- 2 files changed, 19 deletions(-) diff --git a/app/models/spree/product.rb b/app/models/spree/product.rb index 4d65dca35d..96352eba17 100755 --- a/app/models/spree/product.rb +++ b/app/models/spree/product.rb @@ -274,10 +274,6 @@ module Spree !!deleted_at end - def available? - !(available_on.nil? || available_on.future?) - end - # split variants list into hash which shows mapping of opt value onto matching variants # eg categorise_variants_from_option(color) => {"red" -> [...], "blue" -> [...]} def categorise_variants_from_option(opt_type) diff --git a/spec/models/spree/product_spec.rb b/spec/models/spree/product_spec.rb index ee59d0c625..c79afb511e 100644 --- a/spec/models/spree/product_spec.rb +++ b/spec/models/spree/product_spec.rb @@ -85,21 +85,6 @@ module Spree end end - context "#available?" do - it "should be available if date is in the past" do - product.available_on = 1.day.ago - expect(product).to be_available - end - - it "should not be available if date is nil or in the future" do - product.available_on = nil - expect(product).to_not be_available - - product.available_on = 1.day.from_now - expect(product).to_not be_available - end - end - describe 'Variants sorting' do context 'without master variant' do it 'sorts variants by position' do