Class: PactBroker::Versions::BranchVersion

Inherits:
Object
  • Object
show all
Defined in:
lib/pact_broker/versions/branch_version.rb

Instance Method Summary collapse

Instance Method Details

#before_saveObject



22
23
24
25
26
27
# File 'lib/pact_broker/versions/branch_version.rb', line 22

def before_save
  super
  self.version_order = version.order
  self.pacticipant_id = version.pacticipant_id
  self.branch_name = branch.name
end

#latest?Boolean

Returns:

  • (Boolean)


29
30
31
32
# File 'lib/pact_broker/versions/branch_version.rb', line 29

def latest?
  # Should not be possible, not to have a branch head, but have seen this error in the logs
  branch_head&.branch_version_id == id
end

#pacticipantObject



38
39
40
# File 'lib/pact_broker/versions/branch_version.rb', line 38

def pacticipant
  branch.pacticipant
end

#version_numberObject



34
35
36
# File 'lib/pact_broker/versions/branch_version.rb', line 34

def version_number
  version.number
end