Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

chore[Op#54459]: rename `Projects::Scopes::AvailableCustomFields` to include negation scope

Kabiru Mwenja952c5538f817
diff --git a/app/models/project.rb b/app/models/project.rb
index d1d644f167e..fcb9c2fd8f8 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -156,8 +156,8 @@ class Project < ApplicationRecord
friendly_id :identifier, use: :finders
scopes :allowed_to,
- :visible,
- :with_available_custom_fields
+ :available_custom_fields,
+ :visible
scope :has_module, ->(mod) {
where(["#{Project.table_name}.id IN (SELECT em.project_id FROM #{EnabledModule.table_name} em WHERE em.name=?)", mod.to_s])
diff --git a/app/models/projects/scopes/with_available_custom_fields.rb b/app/models/projects/scopes/available_custom_fields.rb
similarity index 98%
rename from app/models/projects/scopes/with_available_custom_fields.rb
rename to app/models/projects/scopes/available_custom_fields.rb
index cac1a5a0ff1..5122b78038b 100644
--- a/app/models/projects/scopes/with_available_custom_fields.rb
+++ b/app/models/projects/scopes/available_custom_fields.rb
@@ -27,7 +27,7 @@
# ++
module Projects::Scopes
- module WithAvailableCustomFields
+ module AvailableCustomFields
extend ActiveSupport::Concern
class_methods do
diff --git a/spec/models/projects/scopes/with_available_custom_fields_spec.rb b/spec/models/projects/scopes/available_custom_fields_spec.rb
similarity index 96%
rename from spec/models/projects/scopes/with_available_custom_fields_spec.rb
rename to spec/models/projects/scopes/available_custom_fields_spec.rb
index 83f384f5d98..8d13425d5f1 100644
--- a/spec/models/projects/scopes/with_available_custom_fields_spec.rb
+++ b/spec/models/projects/scopes/available_custom_fields_spec.rb
@@ -28,7 +28,7 @@
require "spec_helper"
-RSpec.describe Projects::Scopes::WithAvailableCustomFields do
+RSpec.describe Projects::Scopes::AvailableCustomFields do
shared_let(:project) { create(:project) }
shared_let(:project_custom_field) { create(:project_custom_field) }