Sha256: fdf09e4fb795d11085d924a14e054298579c28b14fe121624b763e61447786a9

Contents?: true

Size: 512 Bytes

Versions: 32

Compression:

Stored size: 512 Bytes

Contents

module PactBroker
  module DB
    class Version
      def self.call database_connection
        if database_connection.tables.include?(:schema_migrations)
          last_migration_filename = database_connection[:schema_migrations].order(:filename).last[:filename]
          last_migration_filename.split("_", 2).first.to_i
        elsif database_connection.tables.include?(:schema_info)
          database_connection[:schema_info].first[:version]
        else
          0
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
pact_broker-2.102.2 lib/pact_broker/db/version.rb
pact_broker-2.102.1 lib/pact_broker/db/version.rb
pact_broker-2.102.0 lib/pact_broker/db/version.rb
pact_broker-2.101.0 lib/pact_broker/db/version.rb
pact_broker-2.100.0 lib/pact_broker/db/version.rb
pact_broker-2.99.0 lib/pact_broker/db/version.rb
pact_broker-2.98.0 lib/pact_broker/db/version.rb
pact_broker-2.97.0 lib/pact_broker/db/version.rb
pact_broker-2.96.0 lib/pact_broker/db/version.rb
pact_broker-2.95.1 lib/pact_broker/db/version.rb
pact_broker-2.95.0 lib/pact_broker/db/version.rb
pact_broker-2.94.0 lib/pact_broker/db/version.rb
pact_broker-2.93.4 lib/pact_broker/db/version.rb
pact_broker-2.93.3 lib/pact_broker/db/version.rb
pact_broker-2.93.2 lib/pact_broker/db/version.rb
pact_broker-2.93.1 lib/pact_broker/db/version.rb
pact_broker-2.93.0 lib/pact_broker/db/version.rb
pact_broker-2.92.0 lib/pact_broker/db/version.rb
pact_broker-2.91.0 lib/pact_broker/db/version.rb
pact_broker-2.90.0 lib/pact_broker/db/version.rb