diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 1100c01b35..cc718dafdc 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Omit internal dtproperties table from SQLServer table list. #2729 [rtomayko@gmail.com] + * Quote column names in generated SQL. #2728 [rtomayko@gmail.com] * Correct the pure-Ruby MySQL 4.1.1 shim's version test. #2718 [Jeremy Kemper] diff --git a/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb index 7b0a994b46..fa9ec97794 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb @@ -354,13 +354,15 @@ module ActiveRecord def create_database(name) execute "CREATE DATABASE #{name}" end - + def tables(name = nil) - tables = [] - execute("SELECT table_name from information_schema.tables WHERE table_type = 'BASE TABLE'", name).each {|field| tables << field[0]} - tables + execute("SELECT table_name from information_schema.tables WHERE table_type = 'BASE TABLE'", name).inject([]) do |tables, field| + table_name = field[0] + tables << table_name unless table_name == 'dtproperties' + tables + end end - + def indexes(table_name, name = nil) indexes = [] execute("EXEC sp_helpindex #{table_name}", name).each do |index|