Sha256: 79cfab595df45711b468656fce8721a3adf43344e962f7846913d278c113c3a4

Contents?: true

Size: 1.54 KB

Versions: 4

Compression:

Stored size: 1.54 KB

Contents

module PactBroker
  module Versions
    class BranchHead < Sequel::Model
      set_primary_key :branch_id
      unrestrict_primary_key

      plugin :upsert, identifying_columns: [:branch_id]

      associate(:many_to_one, :branch, :class => "PactBroker::Versions::Branch", :key => :branch_id, :primary_key => :id)
      associate(:many_to_one, :branch_version, :class => "PactBroker::Versions::BranchVersion", :key => :branch_version_id, :primary_key => :id)
      associate(:many_to_one, :version, :class => "PactBroker::Domain::Version", :key => :version_id, :primary_key => :id)

      def before_save
        super
        self.pacticipant_id = branch.pacticipant_id
        self.version_id = branch_version.version_id
        self.branch_name = branch.name
      end

      def branch_name
        branch.name
      end
    end
  end
end

# Table: branch_heads
# Columns:
#  branch_id         | integer | NOT NULL
#  branch_version_id | integer | NOT NULL
#  version_id        | integer | NOT NULL
#  pacticipant_id    | integer | NOT NULL
#  branch_name       | text    | NOT NULL
# Indexes:
#  branch_heads_branch_id_index      | UNIQUE btree (branch_id)
#  branch_heads_branch_name_index    | btree (branch_name)
#  branch_heads_pacticipant_id_index | btree (pacticipant_id)
#  branch_heads_version_id_index     | btree (version_id)
# Foreign key constraints:
#  branch_heads_branch_id_fkey         | (branch_id) REFERENCES branches(id) ON DELETE CASCADE
#  branch_heads_branch_version_id_fkey | (branch_version_id) REFERENCES branch_versions(id) ON DELETE CASCADE

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pact_broker-2.111.0 lib/pact_broker/versions/branch_head.rb
pact_broker-2.109.1 lib/pact_broker/versions/branch_head.rb
pact_broker-2.109.0 lib/pact_broker/versions/branch_head.rb
pact_broker-2.108.0 lib/pact_broker/versions/branch_head.rb