Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/events/projects/project_attributes_changed_event.rb')
-rw-r--r--app/events/projects/project_attributes_changed_event.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/app/events/projects/project_attributes_changed_event.rb b/app/events/projects/project_attributes_changed_event.rb
new file mode 100644
index 00000000000..f7c27fa65e6
--- /dev/null
+++ b/app/events/projects/project_attributes_changed_event.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+module Projects
+ class ProjectAttributesChangedEvent < ::Gitlab::EventStore::Event
+ PAGES_RELATED_ATTRIBUTES = %w[
+ pages_https_only
+ visibility_level
+ ].freeze
+
+ def schema
+ {
+ 'type' => 'object',
+ 'properties' => {
+ 'project_id' => { 'type' => 'integer' },
+ 'namespace_id' => { 'type' => 'integer' },
+ 'root_namespace_id' => { 'type' => 'integer' },
+ 'attributes' => { 'type' => 'array' }
+ },
+ 'required' => %w[project_id namespace_id root_namespace_id attributes]
+ }
+ end
+
+ def pages_related?
+ PAGES_RELATED_ATTRIBUTES.any? do |attribute|
+ data[:attributes].include?(attribute)
+ end
+ end
+ end
+end