Robert Walker wrote:
>
> Pale Horse 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.
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to