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.89.1 lib/pact_broker/db/version.rb
pact_broker-2.89.0 lib/pact_broker/db/version.rb
pact_broker-2.88.0 lib/pact_broker/db/version.rb
pact_broker-2.87.0 lib/pact_broker/db/version.rb
pact_broker-2.86.0 lib/pact_broker/db/version.rb
pact_broker-2.85.1 lib/pact_broker/db/version.rb
pact_broker-2.85.0 lib/pact_broker/db/version.rb
pact_broker-2.84.0 lib/pact_broker/db/version.rb
pact_broker-2.83.0 lib/pact_broker/db/version.rb
pact_broker-2.82.0 lib/pact_broker/db/version.rb
pact_broker-2.81.0 lib/pact_broker/db/version.rb
pact_broker-2.80.0 lib/pact_broker/db/version.rb