Skip to content

Instantly share code, notes, and snippets.

@willcosgrove
Created November 15, 2012 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willcosgrove/4082189 to your computer and use it in GitHub Desktop.
Save willcosgrove/4082189 to your computer and use it in GitHub Desktop.
Supplier Load (0.5ms) SELECT "suppliers".* FROM "suppliers" WHERE "suppliers"."name" = 'S. Rothe' LIMIT 1
PurchaseOrder Load (0.4ms) SELECT "purchase_orders".* FROM "purchase_orders" WHERE (("purchase_orders"."supplier_id" = 43 AND "purchase_orders"."created_at" = '2011-10-31 00:00:00')) LIMIT 1
Winery Load (0.7ms) SELECT "wineries".* FROM "wineries" WHERE "wineries"."name" = 'Robert Keenan' LIMIT 1
Wine Load (0.3ms) SELECT "wines".* FROM "wines" WHERE "wines"."wine_id" = 174385 LIMIT 1
(0.4ms) BEGIN
SQL (0.7ms) INSERT INTO "bottles" ("active", "active_on_winesearcher", "condition", "cost_in_cents", "created_at", "employee_purchase_price_in_cents", "last_sold_on", "marketing_text", "max_quantity_display", "name", "notes", "original_uploaded_quantity", "pick_location", "picture", "purchase_order_id", "purchase_source_type", "quantity", "retail_price_in_cents", "sku", "status", "stock_status", "updated_at", "wine_id", "winesearcher_display_name") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24) RETURNING "id" [["active", true], ["active_on_winesearcher", true], ["condition", ""], ["cost_in_cents", 2713], ["created_at", Thu, 15 Nov 2012 15:03:50 PST -08:00], ["employee_purchase_price_in_cents", 2985], ["last_sold_on", nil], ["marketing_text", ""], ["max_quantity_display", nil], ["name", "Robert Keenan Cabernet Sauvignon Napa Valley 2003"], ["notes", ""], ["original_uploaded_quantity", 0], ["pick_location", "M205"], ["picture", nil], ["purchase_order_id", 103], ["purchase_source_type", "Retail"], ["quantity", 0], ["retail_price_in_cents", 4500], ["sku", 81572], ["status", nil], ["stock_status", "In-Stock"], ["updated_at", Thu, 15 Nov 2012 15:03:50 PST -08:00], ["wine_id", 14658], ["winesearcher_display_name", "Robert Keenan Cabernet Sauvignon Napa Valley 2003"]]
SQL (0.5ms) INSERT INTO "versions" ("created_at", "event", "item_id", "item_type", "object", "object_changes", "whodunnit") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 15 Nov 2012 15:03:50 PST -08:00], ["event", "create"], ["item_id", 304192], ["item_type", "Bottle"], ["object", nil], ["object_changes", nil], ["whodunnit", nil]]
PurchaseOrder Load (0.3ms) SELECT "purchase_orders".* FROM "purchase_orders" WHERE "purchase_orders"."id" = 103 LIMIT 1
SQL (0.3ms) UPDATE "purchase_orders" SET "bottles_count" = COALESCE("bottles_count", 0) + 1 WHERE "purchase_orders"."id" = 103
Wine Load (0.5ms) SELECT "wines".* FROM "wines" WHERE "wines"."id" = 14658 LIMIT 1
(0.7ms) SELECT SUM("line_items"."quantity") AS sum_id FROM "line_items" INNER JOIN "invoices" ON "invoices"."id" = "line_items"."invoice_id" WHERE "line_items"."bottle_id" = 304192 AND ((("invoices"."status" = 'held' OR "invoices"."status" = 'new') OR "invoices"."status" = 'processed'))
(0.5ms) SELECT SUM("line_items"."original_quantity") AS sum_id FROM "line_items" INNER JOIN "invoices" ON "invoices"."id" = "line_items"."invoice_id" WHERE "line_items"."bottle_id" = 304192 AND ((("invoices"."status" = 'held' OR "invoices"."status" = 'new') OR "invoices"."status" = 'processed'))
Supplier Load (0.7ms) SELECT "suppliers".* FROM "suppliers" INNER JOIN "purchase_orders" ON "suppliers"."id" = "purchase_orders"."supplier_id" WHERE "purchase_orders"."id" = 103 LIMIT 1
Winery Load (0.6ms) SELECT "wineries".* FROM "wineries" INNER JOIN "wines" ON "wineries"."id" = "wines"."winery_id" WHERE "wines"."id" = 14658 LIMIT 1
SOLR Request (2.0ms) [ path=#<RSolr::Client:0x007fec84772a90> parameters={data: <?xml version="1.0" encoding="UTF-8"?><add><doc><field name="id">Bottle 304192</field><field name="type">Bottle</field><field name="type">ActiveRecord::Base</field><field name="class_name">Bottle</field><field name="sort_name_s">robert keenan cabernet sauvignon napa valley 2003</field><field name="wine_id_i">174385</field><field name="is_in_stock_b">false</field><field name="created_at_d">2012-11-15T23:03:50Z</field><field name="name_text">Robert Keenan Cabernet Sauvignon Napa Valley 2003</field><field name="supplier_name_text">S. Rothe</field><field name="winery_name_text">Robert Keenan</field><field name="condition_text"></field><field name="country_and_region_text">United States - California</field><field name="sku_text">81572</field></doc></add>, headers: {"Content-Type"=>"text/xml"}, method: post, params: {:wt=>:ruby}, query: wt=ruby, path: update, uri: http://localhost:8982/solr/update?wt=ruby, open_timeout: , read_timeout: } ]
(0.7ms) COMMIT
Supplier Load (0.5ms) SELECT "suppliers".* FROM "suppliers" WHERE "suppliers"."name" = 'M. Yeadon' LIMIT 1
PurchaseOrder Load (0.5ms) SELECT "purchase_orders".* FROM "purchase_orders" WHERE (("purchase_orders"."supplier_id" = 79 AND "purchase_orders"."created_at" = '2012-03-27 00:00:00')) LIMIT 1
Winery Load (0.6ms) SELECT "wineries".* FROM "wineries" WHERE "wineries"."name" = 'Robert Keenan' LIMIT 1
Wine Load (0.3ms) SELECT "wines".* FROM "wines" WHERE "wines"."wine_id" = 136256 LIMIT 1
(0.1ms) BEGIN
Wine Exists (0.4ms) SELECT 1 AS one FROM "wines" WHERE "wines"."wine_id" = 136256 LIMIT 1
SQL (9.5ms) INSERT INTO "wines" ("bottle_size", "country", "created_at", "critic_scores", "kind", "region", "updated_at", "varietal", "vintage", "wine_id", "winery_id") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["bottle_size", "1"], ["country", "United States"], ["created_at", Thu, 15 Nov 2012 15:03:50 PST -08:00], ["critic_scores", "WA95"], ["kind", "Red"], ["region", "California"], ["updated_at", Thu, 15 Nov 2012 15:03:50 PST -08:00], ["varietal", "Cabernet Blends"], ["vintage", "2003"], ["wine_id", 136256], ["winery_id", 2732]]
Bottle Load (0.8ms) SELECT "bottles".* FROM "bottles" WHERE "bottles"."wine_id" = 14672
(2.2ms) SELECT COUNT(*) FROM "bottles" WHERE "bottles"."wine_id" = 14672 AND "bottles"."quantity" > 0
Bottle Load (0.6ms) SELECT "bottles".* FROM "bottles" WHERE "bottles"."wine_id" = 14672 AND "bottles"."quantity" > 0
Bottle Load (0.5ms) SELECT "bottles".* FROM "bottles" WHERE "bottles"."wine_id" = 14672 AND "bottles"."quantity" > 0
(0.2ms) ROLLBACK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment