Skip to content

Instantly share code, notes, and snippets.

@craysiii

craysiii/test.rb Secret

Last active September 19, 2015 00:54
Show Gist options
  • Save craysiii/13cb3c7b61a48c5d5629 to your computer and use it in GitHub Desktop.
Save craysiii/13cb3c7b61a48c5d5629 to your computer and use it in GitHub Desktop.
[0] pry(main)> ActiveRecord::Base.connection.execute('SELECT "wikis".* FROM "wikis" INNER JOIN "collaborators" ON "wikis"."id" = "collaborators"."wiki_id" WHERE "collaborators"."user_id" = 1;')
(0.2ms) SELECT "wikis".* FROM "wikis" INNER JOIN "collaborators" ON "wikis"."id" = "collaborators"."wiki_id" WHERE "collaborators"."user_id" = 1;
=> [{"id"=>65,
"title"=>"some wiki title",
"body"=>"some body here",
"private"=>"f",
"user_id"=>9,
"created_at"=>"2015-09-18 20:37:55.194186",
"updated_at"=>"2015-09-18 20:37:55.194186",
"permalink"=>"some-wiki-title",
0=>65,
1=>"some wiki title",
2=>"some body here",
3=>"f",
4=>9,
5=>"2015-09-18 20:37:55.194186",
6=>"2015-09-18 20:37:55.194186",
7=>"some-wiki-title"}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment