SystemExit: exit

ActionView::TemplateError (SystemExit: exit: SELECT * FROM
product_stocklevels WHERE (product_stocklevels.product_id = 831 AND
(size = ‘W44 L 32’ AND stock > 0)) LIMIT 1)

Before I paste more code, has anyone come across this before?

Pale H. wrote:

ActionView::TemplateError (SystemExit: exit: SELECT * FROM
product_stocklevels WHERE (product_stocklevels.product_id = 831 AND
(size = ‘W44 L 32’ AND stock > 0)) LIMIT 1)

Before I paste more code, has anyone come across this before?

Maybe you need to paste more code. Only think we can tell from this is
that you have a TemplateError in your view. Most likely a syntax error
somewhere.

Robert W. wrote:

Pale H. wrote:

ActionView::TemplateError (SystemExit: exit: SELECT * FROM
product_stocklevels WHERE (product_stocklevels.product_id = 831 AND
(size = ‘W44 L 32’ AND stock > 0)) LIMIT 1)

Before I paste more code, has anyone come across this before?

Maybe you need to paste more code. Only think we can tell from this is
that you have a TemplateError in your view. Most likely a syntax error
somewhere.

The trace shows the following erroneous methods:


def for_size(size, pid)
ret = find(:first, :conditions => [“size = ? AND stock > 0”, size])
ret = ProductStocklevel.create(:product_id => pid, :size => size,
:stock => 0)
unless ret
ret
end
end

def stock_id(size)
self.product_stocklevels.for_size(size, self.id).id.to_s
end


Both are in the Product model. It’s only this particular product, 831,
that is causing this error.