1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove needless change_table

These are using `remove_column` directly, not used `t` in
`change_table`.
This commit is contained in:
Ryuta Kamizono 2017-12-15 17:46:43 +09:00
parent cda7e63abc
commit 3ddb811acc

View file

@ -372,9 +372,7 @@ module ActiveRecord
code = "214fe0c2-dd47-46df-b53b-66090b3c1d40"
Barcode.create!(code: code, other_attr: "xxx")
connection.change_table "barcodes" do |t|
connection.remove_column("barcodes", "other_attr")
end
connection.remove_column("barcodes", "other_attr")
assert_equal code, Barcode.first.id
ensure
@ -392,9 +390,7 @@ module ActiveRecord
code = "214fe0c2-dd47-46df-b53b-66090b3c1d40"
Barcode.create!(region: region, code: code, other_attr: "xxx")
connection.change_table "barcodes" do |t|
connection.remove_column("barcodes", "other_attr")
end
connection.remove_column("barcodes", "other_attr")
assert_equal ["region", "code"], connection.primary_keys("barcodes")