Skip to content

Instantly share code, notes, and snippets.

@miry
Created March 23, 2020 13:23
Show Gist options
  • Save miry/1c5849c22cb3201bc33995222c3f2143 to your computer and use it in GitHub Desktop.
Save miry/1c5849c22cb3201bc33995222c3f2143 to your computer and use it in GitHub Desktop.
# Insert in the string `id: :integer` option any place after first argument, only if it is not specified
# Example without :id option provided
"create_table "cr_bandit_parameters", primary_key: "parameter", force: :cascade do |t|" =>
"create_table "cr_bandit_parameters", primary_key: "parameter", force: :cascade, id: :integer do |t|"
# Example should not be changed because it has id: false
"create_table "cr_bandit_parameters", primary_key: "parameter", id: false, force: :cascade do |t|" =>
"create_table "cr_bandit_parameters", primary_key: "parameter", id: false, force: :cascade do |t|"
# Example should not be changed because it has id: :ineteger
"create_table "cr_bandit_parameters", id: :ineteger, primary_key: "parameter", force: :cascade do |t|" =>
"create_table "cr_bandit_parameters", id: :ineteger, primary_key: "parameter", force: :cascade do |t|"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment