Displaying 5 results from an estimated 5 matches for "description_id".
2006 Jan 18
2
categories/recipes & books/descriptions - has_many vs has_one => id question
People,
In the cookbook eg, categories has_many recipes but in a book eg, book
has_one description - doesn''t that mean that the id of the description
should be the same as the id of the book (instead of having it''s own
"description_id" in the book table?
Thanks,
Phil.
--
Philip Rhoades
Pricom Pty Limited (ACN 003 252 275 ABN 91 003 252 275)
GPO Box 3411
Sydney NSW 2001
Australia
Mobile: +61:(0)411-185-652
Fax: +61:(0)2-8221-9599
E-mail: phil@pricom.com.au
2007 Jul 12
0
[retry] fixture_references: "Mysql::Error #HY000"? (fwd)
I''m resending this with additional information, as I''ve had no
response. I''ve been trying to use the fixture_references plugin,
and I seem to be getting lots of:
1) Error:
test_truth(DeviceTest):
ActiveRecord::StatementInvalid: Mysql::Error: #HY000Field ''description_id'' doesn
''t have a default value: INSERT INTO devices (`id`) VALUES (2)
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection
_adapters/abstract_adapter.rb:128:in `log''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connecti...
2006 Aug 15
0
duplicate entry mystery
...ection 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 duplicate keys in the original table), which
suggests t...
2006 Aug 16
0
mysterious ''duplicate entry'' database error when building table
...c.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 assistance!
stuart
2006 Jul 17
0
Difference between mongrel and webrick handling request.request_uri
If I do this GET request:
GET /comments/new?description_id=1 HTTP/1.1
what ends up in request.request_uri is different for mongrel and webrick:
Mongrel: "/comments/new"
Webrick: "/comments/new?description_id=1"
The mongrel behaviour breaks my app because I''m storing the uri to
redirect to it later. Mongrel even logs the requ...