Rename CustomField filter to CustomFields

Avoids name clashes with the globally defined constant CustomField.

Finn: #3416, Cockpit: #18043.
pull/6827/head
Konstantin Haase 14 years ago
parent 796e494b5f
commit 30d7bc1e43
  1. 2
      app/models/cost_query/filter.rb
  2. 2
      app/models/cost_query/filter/custom_fields.rb
  3. 2
      app/models/cost_query/group_by.rb
  4. 2
      app/models/cost_query/group_by/custom_fields.rb
  5. 10
      spec/models/cost_query/filter_spec.rb
  6. 8
      spec/models/cost_query/group_by_spec.rb

@ -26,7 +26,7 @@ class CostQuery::Filter < Report::Filter
CostQuery::Filter::UpdatedOn,
CostQuery::Filter::UserId,
CostQuery::Filter::PermissionFilter,
*CostQuery::Filter::CustomField.all
*CostQuery::Filter::CustomFields.all
]
end
end

@ -1,5 +1,5 @@
class CostQuery::Filter
class CustomField < Base
class CustomFields < Base
extend CostQuery::CustomFieldMixin
on_prepare do

@ -21,7 +21,7 @@ class CostQuery::GroupBy < Report::GroupBy
CostQuery::GroupBy::AssignedToId,
CostQuery::GroupBy::CategoryId,
CostQuery::GroupBy::StatusId,
*CostQuery::GroupBy::CustomField.all
*CostQuery::GroupBy::CustomFields.all
]
end

@ -1,5 +1,5 @@
class CostQuery::GroupBy
class CustomField < Base
class CustomFields < Base
applies_for :label_issue_attributes
extend CostQuery::CustomFieldMixin
on_prepare { group_fields table_name }

@ -229,9 +229,9 @@ describe CostQuery do
end
end
describe CostQuery::Filter::CustomField do
describe CostQuery::Filter::CustomFields do
before do
CostQuery::Filter.all.merge CostQuery::Filter::CustomField.all
CostQuery::Filter.all.merge CostQuery::Filter::CustomFields.all
end
it "should create classes for custom fields" do
@ -239,13 +239,13 @@ describe CostQuery do
CostQuery::Filter::CustomFieldSearchableField
end
it "includes custom fields classes in CustomField.all" do
CostQuery::Filter::CustomField.all.
it "includes custom fields classes in CustomFields.all" do
CostQuery::Filter::CustomFields.all.
should include(CostQuery::Filter::CustomFieldSearchableField)
end
it "includes custom fields classes in Filter.all" do
CostQuery::Filter::CustomField.all.
CostQuery::Filter::CustomFields.all.
should include(CostQuery::Filter::CustomFieldSearchableField)
end

@ -203,9 +203,9 @@ describe CostQuery do
sub_sql_sizes.sort.should == sub_ruby_sizes.sort
end
describe CostQuery::GroupBy::CustomField do
describe CostQuery::GroupBy::CustomFields do
before do
CostQuery::GroupBy.all.merge CostQuery::GroupBy::CustomField.all
CostQuery::GroupBy.all.merge CostQuery::GroupBy::CustomFields.all
end
it "should create classes for custom fields" do
@ -213,8 +213,8 @@ describe CostQuery do
CostQuery::GroupBy::CustomFieldSearchableField
end
it "includes custom fields classes in CustomField.all" do
CostQuery::GroupBy::CustomField.all.
it "includes custom fields classes in CustomFields.all" do
CostQuery::GroupBy::CustomFields.all.
should include(CostQuery::GroupBy::CustomFieldSearchableField)
end

Loading…
Cancel
Save