Hey guys another rails issue,
Currently have a collection that is line items for an invoicing system. I want to increment the count of the line items if I add in an item that already exists. At the moment I'm using an exists? query on the collection but it seems to return regardless of the key.
The foreign key I'm using is item_id, so I try to do invoice_items.exists?(:item_id => item.id)
This wasn't returning, so I changed it to invoice_items.find(:conditions => ["item_id == ?", item.id)
and I get a return that I cannot search without invoiceItem ID.
Ideas?