Skip to content

Commit

Permalink
chore: comments, rename file
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed May 25, 2018
1 parent 524e08d commit ee4e93d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions lib/pact_broker/matrix/head_row.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class HeadRow < Row
# the entire HeadRow table
# Using the inbuilt relation puts constraints on the columns that are not necessary and slow
# the query down.
# This relation relies on consumer_version_tags already being loaded
one_to_one :latest_verification_for_consumer_version_tag, :class => "PactBroker::Verifications::LatestVerificationForConsumerVersionTag", primary_keys: [], key: [], :eager_loader=>(proc do |eo_opts|
tag_to_row = eo_opts[:rows].each_with_object({}) { | row, map | map[[row.provider_id, row.consumer_id, row.consumer_version_tag_name]] = row }
eo_opts[:rows].each{|row| row.associations[:latest_verification_for_consumer_version_tag] = nil}
Expand Down
1 change: 0 additions & 1 deletion lib/pact_broker/matrix/row.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class Row < Sequel::Model(:materialized_matrix)
associate(:one_to_many, :consumer_version_tags, :class => "PactBroker::Tags::TagWithLatestFlag", primary_key: :consumer_version_id, key: :version_id)
associate(:one_to_many, :provider_version_tags, :class => "PactBroker::Tags::TagWithLatestFlag", primary_key: :provider_version_id, key: :version_id)
associate(:many_to_one, :verification, :class => "PactBroker::Domain::Verification", primary_key: :id, key: :verification_id)
# associate(:many_to_one, :pact_version, :class => "PactBroker::Pacts::PactVersion", primary_key: :id, key: :pact_version_id)

dataset_module do
include PactBroker::Repositories::Helpers
Expand Down

0 comments on commit ee4e93d

Please sign in to comment.