Sha256: 73be75e6493d9308813f89c22d9bcdd8ae32f9fdaf6b452053f0f772c54db068

Contents?: true

Size: 670 Bytes

Versions: 36

Compression:

Stored size: 670 Bytes

Contents

module Workarea
  module Search
    class Admin
      class PricingDiscount < Search::Admin
        include Admin::Releasable

        def type
          'discount'
        end

        def search_text
          "discount #{model.name}"
        end

        def jump_to_text
          model.name
        end

        def jump_to_position
          9
        end

        def keywords
          super + model.promo_codes
        end

        def facets
          super.merge(discount_type: model.class.name.demodulize.titleize)
        end

        def as_document
          super.merge(total_redemptions: model.redemptions.count)
        end
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
workarea-core-3.5.12 app/models/workarea/search/admin/pricing_discount.rb
workarea-core-3.4.33 app/models/workarea/search/admin/pricing_discount.rb
workarea-core-3.5.11 app/models/workarea/search/admin/pricing_discount.rb
workarea-core-3.5.10 app/models/workarea/search/admin/pricing_discount.rb
workarea-core-3.4.32 app/models/workarea/search/admin/pricing_discount.rb
workarea-core-3.5.9 app/models/workarea/search/admin/pricing_discount.rb
workarea-core-3.4.31 app/models/workarea/search/admin/pricing_discount.rb
workarea-core-3.5.8 app/models/workarea/search/admin/pricing_discount.rb
workarea-core-3.4.30 app/models/workarea/search/admin/pricing_discount.rb
workarea-core-3.5.7 app/models/workarea/search/admin/pricing_discount.rb
workarea-core-3.4.29 app/models/workarea/search/admin/pricing_discount.rb
workarea-core-3.5.6 app/models/workarea/search/admin/pricing_discount.rb
workarea-core-3.4.28 app/models/workarea/search/admin/pricing_discount.rb
workarea-core-3.5.5 app/models/workarea/search/admin/pricing_discount.rb
workarea-core-3.4.27 app/models/workarea/search/admin/pricing_discount.rb
workarea-core-3.5.4 app/models/workarea/search/admin/pricing_discount.rb
workarea-core-3.4.26 app/models/workarea/search/admin/pricing_discount.rb
workarea-core-3.5.3 app/models/workarea/search/admin/pricing_discount.rb
workarea-core-3.4.25 app/models/workarea/search/admin/pricing_discount.rb
workarea-core-3.5.2 app/models/workarea/search/admin/pricing_discount.rb