Sha256: 1fd45456fc56f122041a51076b251c9e94fc06b25a272dc1b36f2c963f68e1ff
Contents?: true
Size: 836 Bytes
Versions: 6
Compression:
Stored size: 836 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.data_sources - [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
6 entries across 6 versions & 1 rubygems