lib/pact_broker/domain/pacticipant.rb in pact_broker-2.26.0 vs lib/pact_broker/domain/pacticipant.rb in pact_broker-2.26.1
- old
+ new
@@ -1,21 +1,22 @@
require 'pact_broker/db'
require 'pact_broker/messages'
require 'pact_broker/repositories/helpers'
+require 'pact_broker/versions/latest_version'
+require 'pact_broker/domain/label'
module PactBroker
-
module Domain
-
class Pacticipant < Sequel::Model
include Messages
set_primary_key :id
one_to_many :versions, :order => :order, :reciprocal => :pacticipant
one_to_many :labels, :order => :name, :reciprocal => :pacticipant
one_to_many :pacts
+ one_to_one :latest_version, :class => "PactBroker::Versions::LatestVersion", primary_key: :id, key: :pacticipant_id
dataset_module do
include PactBroker::Repositories::Helpers
def label label_name