aboutsummaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-05-28 20:37:27 +0100
committerChristopher Baines <mail@cbaines.net>2018-05-30 20:17:50 +0100
commitde6535e52fb0eb92689d19e4025997bf090ebc75 (patch)
treeff348ae72c38a3aeffaa8dbb80429b31db555367 /app/models
parent3b135d15e48eafb99395b3f1a62e15e5de1c5a4f (diff)
downloadgovuk-mini-environment-admin-de6535e52fb0eb92689d19e4025997bf090ebc75.tar
govuk-mini-environment-admin-de6535e52fb0eb92689d19e4025997bf090ebc75.tar.gz
Enable editing the services when creating a mini environment
Diffstat (limited to 'app/models')
-rw-r--r--app/models/govuk_guix/revision.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/govuk_guix/revision.rb b/app/models/govuk_guix/revision.rb
index d58e6ad..1072e0d 100644
--- a/app/models/govuk_guix/revision.rb
+++ b/app/models/govuk_guix/revision.rb
@@ -36,4 +36,12 @@ class GovukGuix::Revision < ApplicationRecord
default_scope { order(:created_at).reverse_order }
has_many :mini_environments, foreign_key: 'govuk_guix_revision_id'
+
+ def all_available_services
+ service_lists = available_services.map do |group|
+ group['services']
+ end
+
+ service_lists.flatten
+ end
end