spree/spree — Issue #931: Can't display products when using PostgreSQL
Author: r3ap3r2004
Created: 2011-12-31 04:13:45+00:00
State: open

This is a show stopper because it is impossible to place a product in the cart.

Master Branch:
Attempting to display a product throws the following error when using PostgreSQL>

URL: http://localhost:3000/products/ruby-on-rails-mug

```
ActiveRecord::StatementInvalid in Spree/products#show
Showing core/app/views/spree/products/show.html.erb where line #24 raised:

PGError: ERROR: argument of AND must be type boolean, not type integer
LINE 1: ...e::Promotion') AND "spree_activators"."id" IN (NULL) AND (1)
^
: SELECT COUNT(*) FROM "spree_activators" WHERE "spree_activators"."type" IN ('Spree::Promotion') AND "spree_activators"."id" IN (NULL) AND (1)
```

```
21: <%= render :partial => 'properties' %>
22:

23: <% promotions = @product.possible_promotions %>
24: <% if promotions.any? %>
25:

26:

<%= t(:promotions) %>

27:
```