Created
February 15, 2013 00:27
-
-
Save abrambailey/4957669 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.9.3p286 :001 > @consumer = Consumer.first | |
Creating scope :page. Overwriting existing method Consumer.page. | |
Consumer Load (1.3ms) SELECT "consumers".* FROM "consumers" LIMIT 1 | |
=> #<Consumer id: 29, hl: nil, created_at: "2012-10-27 23:27:15", updated_at: "2012-10-27 23:27:15", user_id: 33, display_name: nil, tagline: nil, desc: nil> | |
1.9.3p286 :002 > @consumer.tags | |
ActsAsTaggableOn::Tag Load (2.3ms) SELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = 29 AND "taggings"."taggable_type" = 'Consumer' AND (taggings.context = 'tags') | |
=> [] | |
1.9.3p286 :003 > @consumer.tag_list | |
ActsAsTaggableOn::Tag Load (1.4ms) SELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = 29 AND "taggings"."taggable_type" = 'Consumer' AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL) | |
=> [] | |
1.9.3p286 :004 > @consumer.tag_list = "hi, ho" | |
=> "hi, ho" | |
1.9.3p286 :005 > @consumer | |
=> #<Consumer id: 29, hl: nil, created_at: "2012-10-27 23:27:15", updated_at: "2012-10-27 23:27:15", user_id: 33, display_name: nil, tagline: nil, desc: nil> | |
1.9.3p286 :006 > @consumer.save | |
(0.4ms) BEGIN | |
(0.7ms) UPDATE "consumers" SET "updated_at" = '2013-02-15 00:25:05.187733' WHERE "consumers"."id" = 29 | |
ActsAsTaggableOn::Tag Load (0.8ms) SELECT "tags".* FROM "tags" WHERE (lower(name) = 'hi' OR lower(name) = 'ho') | |
ActsAsTaggableOn::Tag Exists (0.6ms) SELECT 1 AS one FROM "tags" WHERE "tags"."name" = 'hi' LIMIT 1 | |
SQL (1.3ms) INSERT INTO "tags" ("name") VALUES ($1) RETURNING "id" [["name", "hi"]] | |
ActsAsTaggableOn::Tag Exists (0.5ms) SELECT 1 AS one FROM "tags" WHERE "tags"."name" = 'ho' LIMIT 1 | |
SQL (0.4ms) INSERT INTO "tags" ("name") VALUES ($1) RETURNING "id" [["name", "ho"]] | |
ActsAsTaggableOn::Tag Load (0.7ms) SELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = 29 AND "taggings"."taggable_type" = 'Consumer' AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL) | |
ActsAsTaggableOn::Tagging Exists (0.7ms) SELECT 1 AS one FROM "taggings" WHERE ("taggings"."tag_id" = 5 AND "taggings"."taggable_type" = 'Consumer' AND "taggings"."taggable_id" = 29 AND "taggings"."context" = 'tags' AND "taggings"."tagger_id" IS NULL AND "taggings"."tagger_type" IS NULL) LIMIT 1 | |
SQL (1.5ms) INSERT INTO "taggings" ("context", "created_at", "tag_id", "taggable_id", "taggable_type", "tagger_id", "tagger_type") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["context", "tags"], ["created_at", Fri, 15 Feb 2013 00:25:05 UTC +00:00], ["tag_id", 5], ["taggable_id", 29], ["taggable_type", "Consumer"], ["tagger_id", nil], ["tagger_type", nil]] | |
ActsAsTaggableOn::Tagging Exists (0.7ms) SELECT 1 AS one FROM "taggings" WHERE ("taggings"."tag_id" = 6 AND "taggings"."taggable_type" = 'Consumer' AND "taggings"."taggable_id" = 29 AND "taggings"."context" = 'tags' AND "taggings"."tagger_id" IS NULL AND "taggings"."tagger_type" IS NULL) LIMIT 1 | |
SQL (0.5ms) INSERT INTO "taggings" ("context", "created_at", "tag_id", "taggable_id", "taggable_type", "tagger_id", "tagger_type") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["context", "tags"], ["created_at", Fri, 15 Feb 2013 00:25:05 UTC +00:00], ["tag_id", 6], ["taggable_id", 29], ["taggable_type", "Consumer"], ["tagger_id", nil], ["tagger_type", nil]] | |
(11.9ms) COMMIT | |
=> true | |
1.9.3p286 :007 > Consumer.first.tags | |
Consumer Load (0.9ms) SELECT "consumers".* FROM "consumers" LIMIT 1 | |
ActsAsTaggableOn::Tag Load (1.0ms) SELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = 30 AND "taggings"."taggable_type" = 'Consumer' AND (taggings.context = 'tags') | |
=> [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment