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



22
23
24
# File 'lib/pact_broker/domain/version.rb', line 22

def after_create
  OrderVersions.(self)
end

#before_destroyObject



26
27
28
29
# File 'lib/pact_broker/domain/version.rb', line 26

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

#latest_pact_publicationObject

What about provider??? This makes no sense



40
41
42
# File 'lib/pact_broker/domain/version.rb', line 40

def latest_pact_publication
  pact_publications.last
end

#to_sObject



31
32
33
# File 'lib/pact_broker/domain/version.rb', line 31

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

#version_and_updated_dateObject



35
36
37
# File 'lib/pact_broker/domain/version.rb', line 35

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