lib/pact_broker/domain/pacticipant.rb in pact_broker-2.76.2 vs lib/pact_broker/domain/pacticipant.rb in pact_broker-2.77.0
- old
+ new
@@ -25,10 +25,14 @@
def label label_name
filter = name_like(Sequel[:labels][:name], label_name)
join(:labels, {pacticipant_id: :id}).where(filter)
end
+
+ def find_by_name(name)
+ where(name_like(:name, name))
+ end
end
def before_destroy
PactBroker::Pacts::PactPublication.where(provider: self).delete
PactBroker::Domain::Verification.where(consumer: self).or(provider: self).delete
@@ -49,20 +53,20 @@
def validate
messages = []
messages << message('errors.validation.attribute_missing', attribute: 'name') unless name
messages
end
+
+ def any_versions?
+ PactBroker::Domain::Version.where(pacticipant: self).any?
+ end
end
end
end
-
-
-
-
# Table: pacticipants
# Columns:
-# id | integer | PRIMARY KEY DEFAULT nextval('pacticipants_id_seq'::regclass)
+# id | integer | PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY
# name | text |
# repository_url | text |
# created_at | timestamp without time zone | NOT NULL
# updated_at | timestamp without time zone | NOT NULL
# Indexes: