Class: ActiveRecord::SchemaDumper

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

Overview

Active Record Schema Dumper

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

Constant Summary

@@ignore_tables =
[]

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

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



21
22
23
24
# File 'activerecord/lib/active_record/schema_dumper.rb', line 21

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

Instance Method Details

- (Object) dump(stream)



35
36
37
38
39
40
41
# File 'activerecord/lib/active_record/schema_dumper.rb', line 35

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

- (Object) ignore_tables

: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



17
# File 'activerecord/lib/active_record/schema_dumper.rb', line 17

cattr_accessor :ignore_tables