Method: Spree::Product#discontinued?

Defined in:
app/models/spree/product.rb

#discontinued?Boolean

Determines if product is discontinued.

A product is discontinued if the discontinue_on date is not nil and in the past.

Returns:

  • (Boolean)

    true if this product is discontinued



187
188
189
# File 'app/models/spree/product.rb', line 187

def discontinued?
  !!discontinue_on&.past?
end