Class: PactBroker::DB::Version

Inherits:
Object
  • Object
show all
Defined in:
lib/pact_broker/db/version.rb

Class Method Summary collapse

Class Method Details

.call(database_connection) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/pact_broker/db/version.rb', line 4

def self.call database_connection
  if database_connection.tables.include?(:schema_migrations)
    version_from_schema_migrations(database_connection)
  elsif database_connection.tables.include?(:schema_info)
    version_from_schema_info(database_connection)
  else
    0
  end
end