diff options
author | Tobias Lütke <tobias.luetke@gmail.com> | 2005-12-24 17:31:26 +0000 |
---|---|---|
committer | Tobias Lütke <tobias.luetke@gmail.com> | 2005-12-24 17:31:26 +0000 |
commit | d4e02f755d4de5ddd7eb98afd95391993fbb81d9 (patch) | |
tree | 4c8125b9d072defacacf7ecfa91debb5dfd14636 /activerecord/lib/active_record | |
parent | 87535f50e92f7567d817b455e4f7f4a44371710f (diff) | |
download | rails-d4e02f755d4de5ddd7eb98afd95391993fbb81d9.tar.gz rails-d4e02f755d4de5ddd7eb98afd95391993fbb81d9.tar.bz2 rails-d4e02f755d4de5ddd7eb98afd95391993fbb81d9.zip |
ActiveRecord::Base.schema_ignore_tables => ActiveRecord::SchemaDumper.ignore_tables
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3347 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 6 | ||||
-rw-r--r-- | activerecord/lib/active_record/schema_dumper.rb | 9 |
2 files changed, 7 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 3beabda380..a08cd0f2df 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -332,12 +332,6 @@ module ActiveRecord #:nodoc: cattr_accessor :schema_format @@schema_format = :sql - # A list of tables which should not be dumped to the schema. - # Acceptable values are strings as well as regexp. - # This setting is only used if schema_format == :ruby - cattr_accessor :schema_ignore_tables - @@schema_ignore_tables = [] - class << self # Class methods # Find operates with three different retrieval approaches: # diff --git a/activerecord/lib/active_record/schema_dumper.rb b/activerecord/lib/active_record/schema_dumper.rb index 4898bea203..fa45417153 100644 --- a/activerecord/lib/active_record/schema_dumper.rb +++ b/activerecord/lib/active_record/schema_dumper.rb @@ -4,6 +4,11 @@ module ActiveRecord class SchemaDumper #:nodoc: private_class_method :new + # A list of tables which should not be dumped to the schema. + # Acceptable values are strings as well as regexp. + # This setting is only used if ActiveRecord::Base.schema_format == :ruby + cattr_accessor :ignore_tables + @@ignore_tables = [] def self.dump(connection=ActiveRecord::Base.connection, stream=STDOUT) new(connection).dump(stream) @@ -44,12 +49,12 @@ HEADER def tables(stream) @connection.tables.sort.each do |tbl| - next if ["schema_info", Base.schema_ignore_tables].flatten.any? do |ignored| + next if ["schema_info", ignore_tables].flatten.any? do |ignored| case ignored when String: tbl == ignored when Regexp: tbl =~ ignored else - raise StandardError, 'ActiveRecord::Base.schema_ignore_tables accepts an array of String and / or Regexp values.' + raise StandardError, 'ActiveRecord::SchemaDumper.ignore_tables accepts an array of String and / or Regexp values.' end end table(tbl, stream) |