From 4086f3bafd5db3eb4b67eaa0d30152d029c85feb Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 14 Jan 2022 10:54:24 -0500 Subject: [PATCH] Result::Projects: give a builds method to access all of a project's builds --- src/lib/Hydra/Schema/Result/Projects.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/Hydra/Schema/Result/Projects.pm b/src/lib/Hydra/Schema/Result/Projects.pm index 9513d883..ca446048 100644 --- a/src/lib/Hydra/Schema/Result/Projects.pm +++ b/src/lib/Hydra/Schema/Result/Projects.pm @@ -248,6 +248,11 @@ __PACKAGE__->many_to_many("usernames", "projectmembers", "username"); use JSON::MaybeXS; +sub builds { + my ($self) = @_; + return $self->jobsets->related_resultset('builds'); +}; + sub as_json { my $self = shift;