Sha256: 4a3a693ddb547c164ec7aec5b435d3484cf0c0dff508192fcd4a86590ddd5435

Contents?: true

Size: 1.54 KB

Versions: 42

Compression:

Stored size: 1.54 KB

Contents

require 'pact_broker/matrix/quick_row'

module PactBroker
  module Matrix
    class EveryRow < PactBroker::Matrix::QuickRow
      set_dataset(Sequel.as(:pact_publications, :p))

      P_V_JOIN = { Sequel[:p][:pact_version_id] => Sequel[:v][:pact_version_id] }

      PACT_COLUMNS = [
        Sequel[:p][:consumer_id],
        Sequel[:p][:provider_id],
        Sequel[:p][:consumer_version_id],
        Sequel[:p][:id].as(:pact_publication_id),
        Sequel[:p][:pact_version_id],
        Sequel[:p][:revision_number].as(:pact_revision_number),
        Sequel[:p][:created_at].as(:consumer_version_created_at),
        Sequel[:p][:id].as(:pact_order)
      ]
      VERIFICATION_COLUMNS = [
        Sequel[:v][:id].as(:verification_id),
        Sequel[:v][:provider_version_id],
        Sequel[:v][:created_at].as(:provider_version_created_at)
      ]

      ALL_COLUMNS = PACT_COLUMNS + VERIFICATION_COLUMNS

      SELECT_ALL_COLUMN_ARGS = [:select_all_columns] + ALL_COLUMNS
      dataset_module do
        select *SELECT_ALL_COLUMN_ARGS

        def join_verifications
          left_outer_join(:verifications, P_V_JOIN, { table_alias: :v } )
        end

        def verifications_for(query_ids)
          db[:verifications]
            .select(:id, :pact_version_id, :provider_id, :provider_version_id, :created_at)
            .where {
              Sequel.&(
                QueryBuilder.consumer_in_pacticipant_ids(query_ids),
                QueryBuilder.provider_or_provider_version_matches(query_ids)
              )
            }
        end
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
pact_broker-2.65.0 lib/pact_broker/matrix/every_row.rb
pact_broker-2.64.0 lib/pact_broker/matrix/every_row.rb
pact_broker-2.63.0 lib/pact_broker/matrix/every_row.rb
pact_broker-2.62.0 lib/pact_broker/matrix/every_row.rb
pact_broker-2.61.0 lib/pact_broker/matrix/every_row.rb
pact_broker-2.60.1 lib/pact_broker/matrix/every_row.rb
pact_broker-2.60.0 lib/pact_broker/matrix/every_row.rb
pact_broker-2.59.2 lib/pact_broker/matrix/every_row.rb
pact_broker-2.59.1 lib/pact_broker/matrix/every_row.rb
pact_broker-2.59.0 lib/pact_broker/matrix/every_row.rb
pact_broker-2.58.3 lib/pact_broker/matrix/every_row.rb
pact_broker-2.58.2 lib/pact_broker/matrix/every_row.rb
pact_broker-2.58.0 lib/pact_broker/matrix/every_row.rb
pact_broker-2.57.0 lib/pact_broker/matrix/every_row.rb
pact_broker-2.56.1 lib/pact_broker/matrix/every_row.rb
pact_broker-2.56.0 lib/pact_broker/matrix/every_row.rb
pact_broker-2.55.0 lib/pact_broker/matrix/every_row.rb
pact_broker-2.54.0 lib/pact_broker/matrix/every_row.rb
pact_broker-2.53.0 lib/pact_broker/matrix/every_row.rb
pact_broker-2.52.2 lib/pact_broker/matrix/every_row.rb