Sha256: 522c62d8c70ab337068abc2e66cc7b3674bdf06bbbaf6044345c393762ad6a5a

Contents?: true

Size: 485 Bytes

Versions: 12

Compression:

Stored size: 485 Bytes

Contents

module StrongMigrations
  module SchemaDumper
    def initialize(connection, *args, **options)
      return super unless StrongMigrations.alphabetize_schema

      super(WrappedConnection.new(connection), *args, **options)
    end
  end

  class WrappedConnection
    delegate_missing_to :@connection

    def initialize(connection)
      @connection = connection
    end

    def columns(*args, **options)
      @connection.columns(*args, **options).sort_by(&:name)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
strong_migrations-2.0.0 lib/strong_migrations/schema_dumper.rb
strong_migrations-1.8.0 lib/strong_migrations/schema_dumper.rb
strong_migrations-1.7.0 lib/strong_migrations/schema_dumper.rb
strong_migrations-1.6.4 lib/strong_migrations/schema_dumper.rb
strong_migrations-1.6.3 lib/strong_migrations/schema_dumper.rb
strong_migrations-1.6.2 lib/strong_migrations/schema_dumper.rb
strong_migrations-1.6.1 lib/strong_migrations/schema_dumper.rb
strong_migrations-1.6.0 lib/strong_migrations/schema_dumper.rb
strong_migrations-1.5.0 lib/strong_migrations/schema_dumper.rb
strong_migrations-1.4.4 lib/strong_migrations/schema_dumper.rb
strong_migrations-1.4.3 lib/strong_migrations/schema_dumper.rb
strong_migrations-1.4.2 lib/strong_migrations/schema_dumper.rb