Skip to content

Instantly share code, notes, and snippets.

@benwilson512
Created September 18, 2017 11:59
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 benwilson512/b9c2672aa17ca435c044b559823fd32e to your computer and use it in GitHub Desktop.
Save benwilson512/b9c2672aa17ca435c044b559823fd32e to your computer and use it in GitHub Desktop.
[21] pry(main)> user.organization_ids = [1,2]
[2017-09-18 07:58:18] DEBUG ActiveRecord::Base : Organization Load (0.4ms) SELECT "organizations".* FROM "organizations" WHERE "organizations"."id" IN (1, 2)
[2017-09-18 07:58:18] DEBUG ActiveRecord::Base : (0.1ms) BEGIN
[2017-09-18 07:58:18] DEBUG ActiveRecord::Base : SQL (0.3ms) INSERT INTO "memberships" ("created_at", "organization_id", "updated_at", "user_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-09-18 11:58:18.463433"], ["organization_id", 1], ["updated_at", "2017-09-18 11:58:18.463433"], ["user_id", 1]]
[2017-09-18 07:58:18] DEBUG ActiveRecord::Base : SQL (0.2ms) INSERT INTO "memberships" ("created_at", "organization_id", "updated_at", "user_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2017-09-18 11:58:18.465174"], ["organization_id", 2], ["updated_at", "2017-09-18 11:58:18.465174"], ["user_id", 1]]
[2017-09-18 07:58:18] DEBUG ActiveRecord::Base : (1.1ms) COMMIT
=> [1, 2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment