Class: PactBroker::Domain::Version

Inherits:
Sequel::Model
  • Object
show all
Defined in:
lib/pact_broker/domain/version.rb

Direct Known Subclasses

Versions::LatestVersion

Instance Method Summary collapse

Instance Method Details

#after_createObject



24
25
26
# File 'lib/pact_broker/domain/version.rb', line 24

def after_create
  OrderVersions.(self)
end

#before_destroyObject



28
29
30
31
# File 'lib/pact_broker/domain/version.rb', line 28

def before_destroy
  PactBroker::Domain::Tag.where(version: self).destroy
  super
end

#latest_pact_publicationObject

What about provider??? This makes no sense



42
43
44
# File 'lib/pact_broker/domain/version.rb', line 42

def latest_pact_publication
  pact_publications.last
end

#to_sObject



33
34
35
# File 'lib/pact_broker/domain/version.rb', line 33

def to_s
  "Version: number=#{number}, pacticipant=#{pacticipant_id}"
end

#version_and_updated_dateObject



37
38
39
# File 'lib/pact_broker/domain/version.rb', line 37

def version_and_updated_date
  "Version #{number} - #{updated_at.to_time.localtime.strftime("%d/%m/%Y")}"
end