Sha256: 3bea315f197ca13465b4abb96c452e621857da082a55b51e33fdd7ef18095bbb

Contents?: true

Size: 464 Bytes

Versions: 3

Compression:

Stored size: 464 Bytes

Contents

Spree::Taxon.class_eval do
  include Spree::ActiveSalesHelper
  
  has_many :active_sale_events, :as => :eventable

  # taxon.live_active_sale_event gets first active sale event which is live and active
  def live_active_sale_event
    get_sale_event(self)
  end

  # if there is at least one active sale event which is live and active.
  def live?
    !self.live_active_sale_event.nil?
  end

  def image_available?
    icon?
  end

  def image
    icon
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spree_active_sale-2.0.0 app/models/spree/taxon_decorator.rb
spree_active_sale-1.3.2 app/models/spree/taxon_decorator.rb
spree_active_sale-1.3.1 app/models/spree/taxon_decorator.rb