Skip to content

Instantly share code, notes, and snippets.

@npassaro
Last active May 1, 2020 15:02
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 npassaro/206809313c108399674fbe902a7bfd2b to your computer and use it in GitHub Desktop.
Save npassaro/206809313c108399674fbe902a7bfd2b to your computer and use it in GitHub Desktop.
ActiveRecord generated SQL inserting a good companion
INSERT INTO "companionships" ("green_id", "companion_type", "companion_id", "created_at", "updated_at")
VALUES ($1, $2, $3, $4, $5)
RETURNING "id" [
["green_id", 1],
-- this line should be GoodCompanion
["companion_type", "Green"],
["companion_id", 14],
["created_at", "2020-05-01 13:05:59.823802"],
["updated_at", "2020-05-01 13:05:59.823802"]
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment