Sha256: 3bf0761f15eed06c7058e69ad943469f61ae51db01b6a62edf938d482b9f1fea
Contents?: true
Size: 810 Bytes
Versions: 23
Compression:
Stored size: 810 Bytes
Contents
module SchemaDumpingHelper def dump_table_schema(table, connection = ActiveRecord::Base.connection) old_ignore_tables = ActiveRecord::SchemaDumper.ignore_tables ActiveRecord::SchemaDumper.ignore_tables = connection.tables - [table] stream = StringIO.new ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, stream) stream.string ensure ActiveRecord::SchemaDumper.ignore_tables = old_ignore_tables end def dump_all_table_schema(ignore_tables) old_ignore_tables, ActiveRecord::SchemaDumper.ignore_tables = ActiveRecord::SchemaDumper.ignore_tables, ignore_tables stream = StringIO.new ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, stream) stream.string ensure ActiveRecord::SchemaDumper.ignore_tables = old_ignore_tables end end
Version data entries
23 entries across 23 versions & 6 rubygems