Skip to content

Instantly share code, notes, and snippets.

@teamon
Created August 5, 2008 06:28
Show Gist options
  • Save teamon/4037 to your computer and use it in GitHub Desktop.
Save teamon/4037 to your computer and use it in GitHub Desktop.
>> c.products.opinions
Tue, 05 Aug 2008 06:26:08 GMT ~ debug ~ SELECT "id", "type", "name", "category_id", "created_at", "updated_at", "owner_id" FROM "products" WHERE "deleted_at" IS NULL AND "owner_id" IN (1) ORDER BY "id"
Tue, 05 Aug 2008 06:26:08 GMT ~ debug ~ SELECT "opinions"."id", "opinions"."rank", "opinions"."status", "opinions"."verification_hash", "opinions"."created_at", "opinions"."updated_at", "opinions"."purchased_at", "opinions"."satisfaction", "opinions"."accordance", "opinions"."author_id" FROM "opinions" INNER JOIN "products" ON "products"."id" = "opinions"."product_id" WHERE "opinions"."deleted_at" IS NULL AND "products"."deleted_at" IS NULL AND "products"."owner_id" = 1 ORDER BY "opinions"."id"
Tue, 05 Aug 2008 06:26:08 GMT ~ debug ~ SELECT "opinions"."product_id", "opinions"."id" FROM "opinions" INNER JOIN "products" ON "products"."id" = "opinions"."product_id" WHERE "opinions"."deleted_at" IS NULL AND "products"."deleted_at" IS NULL AND "products"."owner_id" = 1 AND "opinions"."id" IN (1) ORDER BY "opinions"."id"
=> [#<Opinion id=1 rank=1 status=:accepted verification_hash=nil created_at=#<DateTime: 53021169371/21600,1/12,2299161> updated_at=#<DateTime: 1570997611/640,1/12,2299161> deleted_at=<not loaded> text=<not loaded> purchased_at=nil satisfaction=1 accordance=1 author_id=2 product_id=1>]
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment