Loading config/initializers/0_inflections.rb +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ job_artifact_registry vulnerability_feedback vulnerabilities_feedback group_view ) inflect.acronym 'EE' end ee/app/models/ee/user.rb +1 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ module User # User's Group preference # Note: When adding an option, it's value MUST equal to the last value + 1. enum group_view: { details: 1, security_dashboard: 2 }, _prefix: true scope :group_view_details, -> { where('group_view = ? OR group_view IS NULL', group_view[:details]) } end class_methods do Loading ee/spec/lib/gitlab/usage_data_spec.rb +6 −1 Original line number Diff line number Diff line Loading @@ -4,9 +4,10 @@ describe Gitlab::UsageData do before do projects.last.creator.block projects.last.creator.block # to get at least one non-active User end # using Array.new to create a different creator User for each of the projects let(:projects) { Array.new(3) { create(:project, creator: create(:user, group_view: :security_dashboard)) } } let!(:board) { create(:board, project: projects[0]) } Loading @@ -28,6 +29,10 @@ create(:package, project: projects[1]) create(:project_tracing_setting, project: projects[0]) # for group_view testing create(:user) # user with group_view = NULL (should be counted as having default value 'details') create(:user, group_view: :details) end subject { described_class.data } Loading Loading
config/initializers/0_inflections.rb +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ job_artifact_registry vulnerability_feedback vulnerabilities_feedback group_view ) inflect.acronym 'EE' end
ee/app/models/ee/user.rb +1 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ module User # User's Group preference # Note: When adding an option, it's value MUST equal to the last value + 1. enum group_view: { details: 1, security_dashboard: 2 }, _prefix: true scope :group_view_details, -> { where('group_view = ? OR group_view IS NULL', group_view[:details]) } end class_methods do Loading
ee/spec/lib/gitlab/usage_data_spec.rb +6 −1 Original line number Diff line number Diff line Loading @@ -4,9 +4,10 @@ describe Gitlab::UsageData do before do projects.last.creator.block projects.last.creator.block # to get at least one non-active User end # using Array.new to create a different creator User for each of the projects let(:projects) { Array.new(3) { create(:project, creator: create(:user, group_view: :security_dashboard)) } } let!(:board) { create(:board, project: projects[0]) } Loading @@ -28,6 +29,10 @@ create(:package, project: projects[1]) create(:project_tracing_setting, project: projects[0]) # for group_view testing create(:user) # user with group_view = NULL (should be counted as having default value 'details') create(:user, group_view: :details) end subject { described_class.data } Loading