Skip to content

Instantly share code, notes, and snippets.

@dayweek

dayweek/ar8.sql Secret

Last active April 29, 2016 09:37
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/0247fd363301ea91c3a3e4b6ad872027 to your computer and use it in GitHub Desktop.
Save dayweek/0247fd363301ea91c3a3e4b6ad872027 to your computer and use it in GitHub Desktop.
iset = ItemSet.includes(:items).where(name: "The Gladiator").first
ItemSet Load (0.2ms) SELECT "item_sets".* FROM "item_sets"
WHERE "item_sets"."name" = ? ORDER BY "item_sets"."id" ASC LIMIT ?
[["name", "The Gladiator"], ["LIMIT", 1]]
Item Load (0.2ms) SELECT "items".* FROM "items" WHERE "items"."item_set_id" = 1
=> #<ItemSet id: 1, name: "The Gladiator"> iset.items
=> #<ActiveRecord::Associations::CollectionProxy
[#<Item id: 11726, armor: 30, base_armor: 30, buy_price: 146171, container_slots: 0, disenchanting_skill_rank: 175, equippable: true, has_sockets: false, heroic_tooltip: false, icon: "inv_chest_chain_15", inventory_type: 5, is_auctionable: false, item_bind: 1, item_class: 4, item_level: 52, item_sub_class: 3, name: "Savage Gladiator Chain"...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment