Sha256: 1d3d486c02432e808d87a535e6a776ab68fcea8e7998ecfec317c03bc9565b32
Contents?: true
Size: 391 Bytes
Versions: 11
Compression:
Stored size: 391 Bytes
Contents
class VendorTabulatrData < Tabulatr::Data column :name column :url column :active filter :product_price_range do |relation, value| relation = relation.joins(:products) if value == 'low' relation.group("vendors.id").having('AVG(products.price) <= 100') elsif value == 'high' relation.group("vendors.id").having('AVG(products.price) > 100') end end end
Version data entries
11 entries across 11 versions & 1 rubygems