Skip to content

Commit 2d3f01f

Browse files
committed
Remove table_exists? which uses expensive fall back to columns. I'm not sure this is needed? No tests fail when I remove it and arnt you supposed to put :establish_connection(key) in your models when you want to connect to different databases? Removing this saves 20 seconds on test time and helps performance.
1 parent 3e82571 commit 2d3f01f

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

lib/active_record/connection_adapters/sqlserver_adapter.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -577,11 +577,6 @@ def tables(name = nil)
577577
end
578578
end
579579

580-
def table_exists?(table_name)
581-
#If the table is external, see if it has columns
582-
super(table_name) || (columns(table_name).size>0)
583-
end
584-
585580
def columns(table_name, name = nil)
586581
return [] if table_name.blank?
587582
cache_key = unqualify_table_name(table_name)

0 commit comments

Comments
 (0)