spree/spree — Issue #829: old table name in edge
Author: kpitn
Created: 2011-12-01 16:51:26+00:00
State: open

File : /core/lib/spree/product_filters.rb
Line 111 : conds = Hash[*brands.map {|b| [b, "product_properties.value = '#{b}'"]}.flatten]

Error :
Mysql2::Error: Unknown column 'product_properties.value' in 'where clause': SELECT DISTINCT `spree_products`.id FROM `spree_products` INNER JOIN `spree_products_taxons` ON `spree_products_taxons`.`product_id` = `spree_products`.`id` INNER JOIN `spree_taxons` ON `spree_taxons`.`id` = `spree_products_taxons`.`taxon_id` INNER JOIN `spree_product_properties` ON `spree_product_properties`.`product_id` = `spree_products`.`id` INNER JOIN `spree_properties` ON `spree_properties`.`id` = `spree_product_properties`.`property_id` LEFT OUTER JOIN `spree_assets` ON `spree_assets`.`viewable_id` = `spree_products`.`id` AND `spree_assets`.`type` IN ('Spree::Image') AND `spree_assets`.`viewable_type` = 'Spree::Product' LEFT OUTER JOIN `spree_variants` ON `spree_variants`.`product_id` = `spree_products`.`id` AND `spree_variants`.is_master = 1 AND `spree_variants`.deleted_at IS NULL WHERE `spree_products`.`deleted_at` IS NULL AND `spree_taxons`.`id` IN (31989848) AND `spree_properties`.`name` = 'brand' AND (available_on <= '2011-12-01 16:50:26') AND ((product_properties.value = 'Wannabe Sports')) LIMIT 12 OFFSET 0

Solution : add correct table "spree_product_properties"