diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-04 06:01:03 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-04 06:01:03 +0000 |
commit | 4506a463e4af0c7b8fb7fddea1c666520d895271 (patch) | |
tree | 369b6b2d7cac7fdd9e57035868978ca082ed1397 /activerecord/lib | |
parent | fad2aae72b4d2db6ad105cba9ecdffc4855e6ab2 (diff) | |
download | rails-4506a463e4af0c7b8fb7fddea1c666520d895271.tar.gz rails-4506a463e4af0c7b8fb7fddea1c666520d895271.tar.bz2 rails-4506a463e4af0c7b8fb7fddea1c666520d895271.zip |
Omit internal dtproperties table from SQLServer table list. Closes #2729.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2869 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb | 12 |
1 files changed, 7 insertions, 5 deletions
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| |