Skip to content

Instantly share code, notes, and snippets.

@dayweek

dayweek/ar11.sql Secret

Last active April 29, 2016 09:38
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 dayweek/8e9be7340e2c66a1773be558c67c869c to your computer and use it in GitHub Desktop.
Save dayweek/8e9be7340e2c66a1773be558c67c869c to your computer and use it in GitHub Desktop.
iset = ItemSet.includes(:items).where(name: "The Gladiator").where('items.armor > 22').references(:items)
SQL (0.3ms) SELECT "item_sets"."id" AS t0_r0, "item_sets"."name" AS t0_r1,
"items"."id" AS t1_r0, "items"."armor" AS t1_r1, "items"."base_armor" AS t1_r2,
"items"."buy_price" AS t1_r3, "items"."container_slots" AS t1_r4,
"items"."disenchanting_skill_rank" AS t1_r5, "items"."equippable" AS t1_r6,
"items"."has_sockets" AS t1_r7, "items"."heroic_tooltip" AS t1_r8,
"items"."icon" AS t1_r9, "items"."inventory_type" AS t1_r10,
"items"."is_auctionable" AS t1_r11, "items"."item_bind" AS t1_r12,
"items"."item_class" AS t1_r13, "items"."item_level" AS t1_r14,
"items"."item_sub_class" AS t1_r15, "items"."name" AS t1_r16,
"items"."quality" AS t1_r17, "items"."required_level" AS t1_r18,
"items"."required_skill" AS t1_r19, "items"."required_skill_rank" AS t1_r20,
"items"."sell_price" AS t1_r21, "items"."upgradable" AS t1_r22, "items"."name_description" AS t1_r23,
"items"."name_description_color" AS t1_r24, "items"."item_set_id" AS t1_r25 FROM "item_sets"
LEFT OUTER JOIN "items" ON "items"."item_set_id" = "item_sets"."id"
WHERE "item_sets"."name" = ? AND (items.armor > 22) [["name", "The Gladiator"]]
=> #<ActiveRecord::Relation [#<ItemSet id: 1, name: "The Gladiator">]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment