Displaying 4 results from an estimated 4 matches for "inventory_id".
2006 Dec 19
2
Dedupping Has_many through, :unique=>true
Hi, In the Agile book, it is told that by putting a :unique => true will
dedup the row with ActiveRecord.
But it''s not working out for me. Do I need edge rails for this?
I simply want to dedup any join model associations, for instance:
category_id | inventory_id
384 1 first entry
384 2 this would be ok.
384 1 this would not be ok
Any help is appreciated. Thanks
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because...
2006 Aug 15
0
duplicate entry mystery
...s work great for the most
part, but there is a section of code which seems to randomly raise errors. I
have something like this:
homelinks = Syncinventorydesc.find(:all)
InventoryDescription.delete_all()
for link in homelinks
locallink = InventoryDescription.new()
locallink.inventory_id = link.inventory_id
locallink.description_id = link.description_id
locallink.save!
end
this code tears down the local table completely before going through each item
fetched on the remote db and inserting them in. Every now and then i get the
duplicate error message (there a no dupli...
2006 Aug 16
0
mysterious ''duplicate entry'' database error when building table
...b is unreachable
homelinks = Syncinventorydesc.find(:all) #fetch all records
rescue
end
InventoryDescription.delete_all() #drop all records from local table
for link in homelinks #for each record we fetched..
locallink = InventoryDescription.new()
locallink.inventory_id = link.inventory_id
locallink.description_id = link.description_id
locallink.save! #insert into table
end
since it was just a duplicate entry (no loss of data) i just wrapped that save
in a rescue block too. the mystery remains however.. what happened?
thanks for the ass...
2011 Jul 19
0
Problem with nested form using collection_select and date_select
Hello people
I have a table named Items. Items belongs_to inventory, and Items
belongs_to product.
so items looks like
Item
-id
-inventory_id
-product_id
-date
-comments
The main idea is that I want to create an item while I''m creating the
inventory by using nested form in the inventory form (I already test
creating item with its own methods and forms and works fine), and I
get an error message saying that "product_id"...