Class: ActiveRecord::SchemaDumper

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/schema_dumper.rb

Overview

This class is used to dump the database schema for some connection to some output format (i.e., ActiveRecord::Schema).

Constant Summary collapse

@@ignore_tables =
[]

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.dump(connection = ActiveRecord::Base.connection, stream = STDOUT) ⇒ Object



18
19
20
21
# File 'lib/active_record/schema_dumper.rb', line 18

def self.dump(connection=ActiveRecord::Base.connection, stream=STDOUT)
  new(connection).dump(stream)
  stream
end

Instance Method Details

#dump(stream) ⇒ Object



23
24
25
26
27
28
# File 'lib/active_record/schema_dumper.rb', line 23

def dump(stream)
  header(stream)
  tables(stream)
  trailer(stream)
  stream
end

#ignore_tablesObject

:singleton-method: 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



15
# File 'lib/active_record/schema_dumper.rb', line 15

cattr_accessor :ignore_tables