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

Merge pull request #16867 from yahonda/use_drop_table_to_drop_sequences

Replace drop sql statement to drop_table method
This commit is contained in:
Rafael Mendonça França 2014-09-10 16:06:05 -03:00
commit 44ed7a8e5c
3 changed files with 5 additions and 5 deletions

View file

@ -18,8 +18,8 @@ class RequiredAssociationsTest < ActiveRecord::TestCase
end end
teardown do teardown do
@connection.execute("DROP TABLE parents") if @connection.table_exists? 'parents' @connection.drop_table 'parents' if @connection.table_exists? 'parents'
@connection.execute("DROP TABLE children") if @connection.table_exists? 'children' @connection.drop_table 'children' if @connection.table_exists? 'children'
end end
test "belongs_to associations are not required by default" do test "belongs_to associations are not required by default" do

View file

@ -28,7 +28,7 @@ module ActiveRecord
teardown do teardown do
return unless @connection return unless @connection
@connection.execute 'DROP TABLE attribute_decorators_model' if @connection.table_exists? 'attribute_decorators_model' @connection.drop_table 'attribute_decorators_model' if @connection.table_exists? 'attribute_decorators_model'
Model.attribute_type_decorations.clear Model.attribute_type_decorations.clear
Model.reset_column_information Model.reset_column_information
end end

View file

@ -29,8 +29,8 @@ module ActiveRecord
teardown do teardown do
if defined?(@connection) if defined?(@connection)
@connection.execute "DROP TABLE astronauts" if @connection.table_exists? 'astronauts' @connection.drop_table "astronauts" if @connection.table_exists? 'astronauts'
@connection.execute "DROP TABLE rockets" if @connection.table_exists? 'rockets' @connection.drop_table "rockets" if @connection.table_exists? 'rockets'
end end
end end