spree_product_groups icon indicating copy to clipboard operation
spree_product_groups copied to clipboard

Lack of GROUP BY clause cause postgres error

Open lukkry opened this issue 12 years ago • 0 comments

When I combine in_taxons scope with sort by master_price (using spree 1.1.1) I get postgres error:

searcher = Spree::Core::Search::ProductGroupBase.new(:product_group_query =>"in_taxons/Mugs/ascend_by_master_price")
searcher.retrieve_products

# ActiveRecord::StatementInvalid: PG::Error: ERROR:  column "spree_variants.price" must appear in the GROUP BY clause or be used in an aggregate function

full log: https://gist.github.com/2858938

You can see this error, when you install fresh spree 1.1.1 shop and try to access url http://localhost:3000/s/in_taxons/Mugs/ascend_by_master_price

lukkry avatar Jun 02 '12 16:06 lukkry