Skip to content

Commit f2595ac

Browse files
Merge pull request #134 from doctolib/fix_create_table_args
Fix args bug for create_table
2 parents cc4505a + 26c4ec8 commit f2595ac

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/safe-pg-migrations/plugins/statement_insurer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def add_foreign_key(from_table, to_table, **options)
4242
validate_foreign_key from_table, sub_options.present? ? nil : to_table, **sub_options
4343
end
4444

45-
def create_table(*)
45+
def create_table(table_name, **options)
4646
super do |td|
4747
yield td if block_given?
4848
td.indexes.map! do |key, index_options|

test/StatementInsurer/statement_insurer_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def test_create_table
147147
@migration =
148148
Class.new(ActiveRecord::Migration::Current) do
149149
def change
150-
create_table(:users) do |t|
150+
create_table(:users, primary_key: nil) do |t|
151151
t.string :email
152152
t.references :user, foreign_key: true
153153
end

0 commit comments

Comments
 (0)