Class: ActiveRecord::SchemaDumper
- Inherits:
-
Object
- Object
- ActiveRecord::SchemaDumper
- Defined in:
- 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 collapse
- @@ignore_tables =
[]
Class Method Summary collapse
Instance Method Summary collapse
- #dump(stream) ⇒ Object
-
#ignore_tables ⇒ Object
:singleton-method: A list of tables which should not be dumped to the schema.
Class Method Details
.dump(connection = ActiveRecord::Base.connection, stream = STDOUT, config = ActiveRecord::Base) ⇒ Object
20 21 22 23 |
# File 'lib/active_record/schema_dumper.rb', line 20 def dump(connection = ActiveRecord::Base.connection, stream = STDOUT, config = ActiveRecord::Base) new(connection, (config)).dump(stream) stream end |
Instance Method Details
#dump(stream) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/active_record/schema_dumper.rb', line 34 def dump(stream) header(stream) extensions(stream) tables(stream) trailer(stream) stream end |
#ignore_tables ⇒ Object
: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
16 |
# File 'lib/active_record/schema_dumper.rb', line 16 cattr_accessor :ignore_tables |