From 1ae7cb36a4cd3a6f91080468f28d9e316465a102 Mon Sep 17 00:00:00 2001 From: Christian Rijke Date: Thu, 20 Jun 2013 16:25:38 +0200 Subject: [PATCH 1/2] Remove empty subclass 'CostQuery::GroupBy::Base' and inherit from Report::GroupBy::Base instead. Class loading happens in alphabetical order, thus causing activity_id.rb, assigned_to_id.rb and author_id.rb to be loaded before base.rb. As the superclass 'Base' was referenced without additional qualification, these classes ended up being subclasses of Report::GroupBy::Base while all other classes (after base.rb) became subclasses of CostQuery::GroupBy::Base. This caused weird and inconsistent behavior when combining ('chaining') grouping criteria in production mode. --- app/models/cost_query/group_by/activity_id.rb | 9 +++------ app/models/cost_query/group_by/assigned_to_id.rb | 12 +++++------- app/models/cost_query/group_by/author_id.rb | 12 +++++------- app/models/cost_query/group_by/base.rb | 1 - app/models/cost_query/group_by/category_id.rb | 12 +++++------- app/models/cost_query/group_by/cost_object_id.rb | 12 +++++------- app/models/cost_query/group_by/cost_type_id.rb | 8 +++----- .../cost_query/group_by/custom_field_entries.rb | 10 ++++------ app/models/cost_query/group_by/fixed_version_id.rb | 12 +++++------- app/models/cost_query/group_by/issue_id.rb | 8 +++----- app/models/cost_query/group_by/priority_id.rb | 12 +++++------- app/models/cost_query/group_by/project_id.rb | 8 +++----- app/models/cost_query/group_by/ruby_aggregation.rb | 2 +- app/models/cost_query/group_by/spent_on.rb | 9 +++------ app/models/cost_query/group_by/status_id.rb | 12 +++++------- app/models/cost_query/group_by/tmonth.rb | 8 +++----- app/models/cost_query/group_by/tracker_id.rb | 12 +++++------- app/models/cost_query/group_by/tweek.rb | 8 +++----- app/models/cost_query/group_by/tyear.rb | 8 +++----- app/models/cost_query/group_by/user_id.rb | 8 +++----- app/models/cost_query/group_by/week.rb | 9 +++------ 21 files changed, 75 insertions(+), 117 deletions(-) delete mode 100644 app/models/cost_query/group_by/base.rb diff --git a/app/models/cost_query/group_by/activity_id.rb b/app/models/cost_query/group_by/activity_id.rb index 1da6f81f7d..755ea9e722 100644 --- a/app/models/cost_query/group_by/activity_id.rb +++ b/app/models/cost_query/group_by/activity_id.rb @@ -1,8 +1,5 @@ -class CostQuery::GroupBy - class ActivityId < Base - - def self.label - TimeEntry.human_attribute_name(:activity) - end +class CostQuery::GroupBy::ActivityId < Report::GroupBy::Base + def self.label + TimeEntry.human_attribute_name(:activity) end end diff --git a/app/models/cost_query/group_by/assigned_to_id.rb b/app/models/cost_query/group_by/assigned_to_id.rb index 65d0514a36..93b451eeb0 100644 --- a/app/models/cost_query/group_by/assigned_to_id.rb +++ b/app/models/cost_query/group_by/assigned_to_id.rb @@ -1,10 +1,8 @@ -class CostQuery::GroupBy - class AssignedToId < Base - join_table Issue - applies_for :label_issue_attributes +class CostQuery::GroupBy::AssignedToId < Report::GroupBy::Base + join_table Issue + applies_for :label_issue_attributes - def self.label - Issue.human_attribute_name(:assigned_to) - end + def self.label + Issue.human_attribute_name(:assigned_to) end end diff --git a/app/models/cost_query/group_by/author_id.rb b/app/models/cost_query/group_by/author_id.rb index d226b8c1c3..26babeb82d 100644 --- a/app/models/cost_query/group_by/author_id.rb +++ b/app/models/cost_query/group_by/author_id.rb @@ -1,10 +1,8 @@ -class CostQuery::GroupBy - class AuthorId < Base - join_table Issue - applies_for :label_issue_attributes +class CostQuery::GroupBy::AuthorId < Report::GroupBy::Base + join_table Issue + applies_for :label_issue_attributes - def self.label - Issue.human_attribute_name(:author) - end + def self.label + Issue.human_attribute_name(:author) end end diff --git a/app/models/cost_query/group_by/base.rb b/app/models/cost_query/group_by/base.rb deleted file mode 100644 index 6aff1574f1..0000000000 --- a/app/models/cost_query/group_by/base.rb +++ /dev/null @@ -1 +0,0 @@ -class CostQuery::GroupBy::Base < Report::GroupBy::Base; end diff --git a/app/models/cost_query/group_by/category_id.rb b/app/models/cost_query/group_by/category_id.rb index c847524fbf..6005a3d31b 100644 --- a/app/models/cost_query/group_by/category_id.rb +++ b/app/models/cost_query/group_by/category_id.rb @@ -1,10 +1,8 @@ -class CostQuery::GroupBy - class CategoryId < Base - join_table Issue - applies_for :label_issue_attributes +class CostQuery::GroupBy::CategoryId < Report::GroupBy::Base + join_table Issue + applies_for :label_issue_attributes - def self.label - Issue.human_attribute_name(:category) - end + def self.label + Issue.human_attribute_name(:category) end end diff --git a/app/models/cost_query/group_by/cost_object_id.rb b/app/models/cost_query/group_by/cost_object_id.rb index c3c3c49d04..5508982e55 100644 --- a/app/models/cost_query/group_by/cost_object_id.rb +++ b/app/models/cost_query/group_by/cost_object_id.rb @@ -1,10 +1,8 @@ -class CostQuery::GroupBy - class CostObjectId < Base - join_table Issue - applies_for :label_issue_attributes +class CostQuery::GroupBy::CostObjectId < Report::GroupBy::Base + join_table Issue + applies_for :label_issue_attributes - def self.label - CostObject.model_name.human - end + def self.label + CostObject.model_name.human end end diff --git a/app/models/cost_query/group_by/cost_type_id.rb b/app/models/cost_query/group_by/cost_type_id.rb index b7082abed2..71547d2d97 100644 --- a/app/models/cost_query/group_by/cost_type_id.rb +++ b/app/models/cost_query/group_by/cost_type_id.rb @@ -1,8 +1,6 @@ -class CostQuery::GroupBy - class CostTypeId < Base +class CostQuery::GroupBy::CostTypeId < Report::GroupBy::Base - def self.label - CostType.model_name.human - end + def self.label + CostType.model_name.human end end diff --git a/app/models/cost_query/group_by/custom_field_entries.rb b/app/models/cost_query/group_by/custom_field_entries.rb index 02df6a4666..bfff70472a 100644 --- a/app/models/cost_query/group_by/custom_field_entries.rb +++ b/app/models/cost_query/group_by/custom_field_entries.rb @@ -1,7 +1,5 @@ -class CostQuery::GroupBy - class CustomFieldEntries < Base - applies_for :label_issue_attributes - extend CostQuery::CustomFieldMixin - on_prepare { group_fields table_name } - end +class CostQuery::GroupBy::CustomFieldEntries < Report::GroupBy::Base + applies_for :label_issue_attributes + extend CostQuery::CustomFieldMixin + on_prepare { group_fields table_name } end diff --git a/app/models/cost_query/group_by/fixed_version_id.rb b/app/models/cost_query/group_by/fixed_version_id.rb index 365fca17de..fbb7728043 100644 --- a/app/models/cost_query/group_by/fixed_version_id.rb +++ b/app/models/cost_query/group_by/fixed_version_id.rb @@ -1,10 +1,8 @@ -class CostQuery::GroupBy - class FixedVersionId < Base - join_table Issue - applies_for :label_issue_attributes +class CostQuery::GroupBy::FixedVersionId < Report::GroupBy::Base + join_table Issue + applies_for :label_issue_attributes - def self.label - Issue.human_attribute_name(:fixed_version) - end + def self.label + Issue.human_attribute_name(:fixed_version) end end diff --git a/app/models/cost_query/group_by/issue_id.rb b/app/models/cost_query/group_by/issue_id.rb index 68428ee742..d6de66e319 100644 --- a/app/models/cost_query/group_by/issue_id.rb +++ b/app/models/cost_query/group_by/issue_id.rb @@ -1,8 +1,6 @@ -class CostQuery::GroupBy - class IssueId < Base +class CostQuery::GroupBy::IssueId < Report::GroupBy::Base - def self.label - Issue.model_name.human - end + def self.label + Issue.model_name.human end end diff --git a/app/models/cost_query/group_by/priority_id.rb b/app/models/cost_query/group_by/priority_id.rb index e812ae6a36..450ecc42be 100644 --- a/app/models/cost_query/group_by/priority_id.rb +++ b/app/models/cost_query/group_by/priority_id.rb @@ -1,10 +1,8 @@ -class CostQuery::GroupBy - class PriorityId < Base - join_table Issue - applies_for :label_issue_attributes +class CostQuery::GroupBy::PriorityId < Report::GroupBy::Base + join_table Issue + applies_for :label_issue_attributes - def self.label - Issue.human_attribute_name(:priority) - end + def self.label + Issue.human_attribute_name(:priority) end end diff --git a/app/models/cost_query/group_by/project_id.rb b/app/models/cost_query/group_by/project_id.rb index 6ae2e734ab..1f9f0e7e89 100644 --- a/app/models/cost_query/group_by/project_id.rb +++ b/app/models/cost_query/group_by/project_id.rb @@ -1,8 +1,6 @@ -class CostQuery::GroupBy - class ProjectId < Base +class CostQuery::GroupBy::ProjectId < Report::GroupBy::Base - def self.label - Project.model_name.human - end + def self.label + Project.model_name.human end end diff --git a/app/models/cost_query/group_by/ruby_aggregation.rb b/app/models/cost_query/group_by/ruby_aggregation.rb index 92deb447c6..04d8ee88b1 100644 --- a/app/models/cost_query/group_by/ruby_aggregation.rb +++ b/app/models/cost_query/group_by/ruby_aggregation.rb @@ -10,4 +10,4 @@ class CostQuery::GroupBy child.result.grouped_by(all_group_fields(false), type, group_fields) end end -end \ No newline at end of file +end diff --git a/app/models/cost_query/group_by/spent_on.rb b/app/models/cost_query/group_by/spent_on.rb index c3b6ee75c7..9b969fcdc5 100644 --- a/app/models/cost_query/group_by/spent_on.rb +++ b/app/models/cost_query/group_by/spent_on.rb @@ -1,8 +1,5 @@ -class CostQuery::GroupBy - class SpentOn < Base - - def self.label - I18n.t(:label_spent_on_reporting) - end +class CostQuery::GroupBy::SpentOn < Report::GroupBy::Base + def self.label + I18n.t(:label_spent_on_reporting) end end diff --git a/app/models/cost_query/group_by/status_id.rb b/app/models/cost_query/group_by/status_id.rb index 8d6da4fd5b..7df4c9d51b 100644 --- a/app/models/cost_query/group_by/status_id.rb +++ b/app/models/cost_query/group_by/status_id.rb @@ -1,10 +1,8 @@ -class CostQuery::GroupBy - class StatusId < Base - join_table Issue - applies_for :label_issue_attributes +class CostQuery::GroupBy::StatusId < Report::GroupBy::Base + join_table Issue + applies_for :label_issue_attributes - def self.label - Issue.human_attribute_name(:status) - end + def self.label + Issue.human_attribute_name(:status) end end diff --git a/app/models/cost_query/group_by/tmonth.rb b/app/models/cost_query/group_by/tmonth.rb index 2fefedf323..321af3df36 100644 --- a/app/models/cost_query/group_by/tmonth.rb +++ b/app/models/cost_query/group_by/tmonth.rb @@ -1,8 +1,6 @@ -class CostQuery::GroupBy - class Tmonth < Base +class CostQuery::GroupBy::Tmonth < Report::GroupBy::Base - def self.label - I18n.t(:label_month_reporting) - end + def self.label + I18n.t(:label_month_reporting) end end diff --git a/app/models/cost_query/group_by/tracker_id.rb b/app/models/cost_query/group_by/tracker_id.rb index 939192be5b..cee719edd1 100644 --- a/app/models/cost_query/group_by/tracker_id.rb +++ b/app/models/cost_query/group_by/tracker_id.rb @@ -1,10 +1,8 @@ -class CostQuery::GroupBy - class TrackerId < Base - join_table Issue - applies_for :label_issue_attributes +class CostQuery::GroupBy::TrackerId < Report::GroupBy::Base + join_table Issue + applies_for :label_issue_attributes - def self.label - Issue.human_attribute_name(:tracker) - end + def self.label + Issue.human_attribute_name(:tracker) end end diff --git a/app/models/cost_query/group_by/tweek.rb b/app/models/cost_query/group_by/tweek.rb index 1a733710da..06c9f3f29d 100644 --- a/app/models/cost_query/group_by/tweek.rb +++ b/app/models/cost_query/group_by/tweek.rb @@ -1,8 +1,6 @@ -class CostQuery::GroupBy - class Tweek < Base +class CostQuery::GroupBy::Tweek < Report::GroupBy::Base - def self.label - I18n.t(:label_week_reporting) - end + def self.label + I18n.t(:label_week_reporting) end end diff --git a/app/models/cost_query/group_by/tyear.rb b/app/models/cost_query/group_by/tyear.rb index fe41f579c2..4b6ee941e4 100644 --- a/app/models/cost_query/group_by/tyear.rb +++ b/app/models/cost_query/group_by/tyear.rb @@ -1,8 +1,6 @@ -class CostQuery::GroupBy - class Tyear < Base +class CostQuery::GroupBy::Tyear < Report::GroupBy::Base - def self.label - I18n.t(:label_year_reporting) - end + def self.label + I18n.t(:label_year_reporting) end end diff --git a/app/models/cost_query/group_by/user_id.rb b/app/models/cost_query/group_by/user_id.rb index 86317be9a2..4fec336929 100644 --- a/app/models/cost_query/group_by/user_id.rb +++ b/app/models/cost_query/group_by/user_id.rb @@ -1,8 +1,6 @@ -class CostQuery::GroupBy - class UserId < Base +class CostQuery::GroupBy::UserId < Report::GroupBy::Base - def self.label - Issue.human_attribute_name(:user) - end + def self.label + Issue.human_attribute_name(:user) end end diff --git a/app/models/cost_query/group_by/week.rb b/app/models/cost_query/group_by/week.rb index 835d36d026..496e93ce48 100644 --- a/app/models/cost_query/group_by/week.rb +++ b/app/models/cost_query/group_by/week.rb @@ -1,8 +1,5 @@ -class CostQuery::GroupBy - class Week < Base - - def self.label - I18n.t(:label_week_reporting) - end +class CostQuery::GroupBy::Week < Report::GroupBy::Base + def self.label + I18n.t(:label_week_reporting) end end From a0dcacb06f0b3b57840daeb2f8d61e3d147b8d89 Mon Sep 17 00:00:00 2001 From: Christian Rijke Date: Thu, 20 Jun 2013 16:26:58 +0200 Subject: [PATCH 2/2] Also remove inherited base class from filters. --- app/models/cost_query/filter/activity_id.rb | 2 +- app/models/cost_query/filter/assigned_to_id.rb | 2 +- app/models/cost_query/filter/author_id.rb | 2 +- app/models/cost_query/filter/base.rb | 1 - app/models/cost_query/filter/category_id.rb | 2 +- app/models/cost_query/filter/cost_object_id.rb | 2 +- app/models/cost_query/filter/cost_type_id.rb | 2 +- app/models/cost_query/filter/created_on.rb | 4 ++-- app/models/cost_query/filter/due_date.rb | 2 +- app/models/cost_query/filter/fixed_version_id.rb | 2 +- app/models/cost_query/filter/issue_id.rb | 2 +- app/models/cost_query/filter/overridden_costs.rb | 2 +- app/models/cost_query/filter/permission_filter.rb | 2 +- app/models/cost_query/filter/priority_id.rb | 2 +- app/models/cost_query/filter/project_id.rb | 2 +- app/models/cost_query/filter/spent_on.rb | 2 +- app/models/cost_query/filter/start_date.rb | 2 +- app/models/cost_query/filter/status_id.rb | 2 +- app/models/cost_query/filter/subject.rb | 2 +- app/models/cost_query/filter/tmonth.rb | 2 +- app/models/cost_query/filter/tracker_id.rb | 2 +- app/models/cost_query/filter/tweek.rb | 2 +- app/models/cost_query/filter/tyear.rb | 2 +- app/models/cost_query/filter/updated_on.rb | 4 ++-- app/models/cost_query/filter/user_id.rb | 2 +- spec/models/cost_query/chaining_spec.rb | 14 +++++++------- 26 files changed, 33 insertions(+), 34 deletions(-) delete mode 100644 app/models/cost_query/filter/base.rb diff --git a/app/models/cost_query/filter/activity_id.rb b/app/models/cost_query/filter/activity_id.rb index 2e0c51931f..dc37e325bf 100644 --- a/app/models/cost_query/filter/activity_id.rb +++ b/app/models/cost_query/filter/activity_id.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::ActivityId < CostQuery::Filter::Base +class CostQuery::Filter::ActivityId < Report::Filter::Base def self.label TimeEntry.human_attribute_name(:activity) diff --git a/app/models/cost_query/filter/assigned_to_id.rb b/app/models/cost_query/filter/assigned_to_id.rb index 0a127c8833..d02495cb1f 100644 --- a/app/models/cost_query/filter/assigned_to_id.rb +++ b/app/models/cost_query/filter/assigned_to_id.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::AssignedToId < CostQuery::Filter::Base +class CostQuery::Filter::AssignedToId < Report::Filter::Base use :null_operators join_table Issue applies_for :label_issue_attributes diff --git a/app/models/cost_query/filter/author_id.rb b/app/models/cost_query/filter/author_id.rb index f73c91c3a3..0e48c53b27 100644 --- a/app/models/cost_query/filter/author_id.rb +++ b/app/models/cost_query/filter/author_id.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::AuthorId < CostQuery::Filter::Base +class CostQuery::Filter::AuthorId < Report::Filter::Base join_table Issue applies_for :label_issue_attributes diff --git a/app/models/cost_query/filter/base.rb b/app/models/cost_query/filter/base.rb deleted file mode 100644 index b02c395710..0000000000 --- a/app/models/cost_query/filter/base.rb +++ /dev/null @@ -1 +0,0 @@ -class CostQuery::Filter::Base < Report::Filter::Base; end diff --git a/app/models/cost_query/filter/category_id.rb b/app/models/cost_query/filter/category_id.rb index 537504d50d..c6f100b9c3 100644 --- a/app/models/cost_query/filter/category_id.rb +++ b/app/models/cost_query/filter/category_id.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::CategoryId < CostQuery::Filter::Base +class CostQuery::Filter::CategoryId < Report::Filter::Base use :null_operators join_table Issue applies_for :label_issue_attributes diff --git a/app/models/cost_query/filter/cost_object_id.rb b/app/models/cost_query/filter/cost_object_id.rb index be045cd610..209d80e29d 100644 --- a/app/models/cost_query/filter/cost_object_id.rb +++ b/app/models/cost_query/filter/cost_object_id.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::CostObjectId < CostQuery::Filter::Base +class CostQuery::Filter::CostObjectId < Report::Filter::Base join_table Project applies_for :label_issue_attributes diff --git a/app/models/cost_query/filter/cost_type_id.rb b/app/models/cost_query/filter/cost_type_id.rb index d4a174fed7..005b92061f 100644 --- a/app/models/cost_query/filter/cost_type_id.rb +++ b/app/models/cost_query/filter/cost_type_id.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::CostTypeId < CostQuery::Filter::Base +class CostQuery::Filter::CostTypeId < Report::Filter::Base extra_options :display selectable false diff --git a/app/models/cost_query/filter/created_on.rb b/app/models/cost_query/filter/created_on.rb index c38dd4fec2..8e23ebb1dd 100644 --- a/app/models/cost_query/filter/created_on.rb +++ b/app/models/cost_query/filter/created_on.rb @@ -1,8 +1,8 @@ -class CostQuery::Filter::CreatedOn < CostQuery::Filter::Base +class CostQuery::Filter::CreatedOn < Report::Filter::Base db_field "entries.created_on" use :time_operators def self.label Issue.human_attribute_name(:created_on) end -end \ No newline at end of file +end diff --git a/app/models/cost_query/filter/due_date.rb b/app/models/cost_query/filter/due_date.rb index 8275e8fc82..2b1b953588 100644 --- a/app/models/cost_query/filter/due_date.rb +++ b/app/models/cost_query/filter/due_date.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::DueDate < CostQuery::Filter::Base +class CostQuery::Filter::DueDate < Report::Filter::Base use :time_operators join_table Issue applies_for :label_issue_attributes diff --git a/app/models/cost_query/filter/fixed_version_id.rb b/app/models/cost_query/filter/fixed_version_id.rb index d34b8909a8..f2140a02cb 100644 --- a/app/models/cost_query/filter/fixed_version_id.rb +++ b/app/models/cost_query/filter/fixed_version_id.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::FixedVersionId < CostQuery::Filter::Base +class CostQuery::Filter::FixedVersionId < Report::Filter::Base use :null_operators join_table Issue applies_for :label_issue_attributes diff --git a/app/models/cost_query/filter/issue_id.rb b/app/models/cost_query/filter/issue_id.rb index fa855ef3a9..54e6dc86be 100644 --- a/app/models/cost_query/filter/issue_id.rb +++ b/app/models/cost_query/filter/issue_id.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::IssueId < CostQuery::Filter::Base +class CostQuery::Filter::IssueId < Report::Filter::Base def self.label Issue.model_name.human diff --git a/app/models/cost_query/filter/overridden_costs.rb b/app/models/cost_query/filter/overridden_costs.rb index 7867d67797..4c71e5ccab 100644 --- a/app/models/cost_query/filter/overridden_costs.rb +++ b/app/models/cost_query/filter/overridden_costs.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::OverriddenCosts < CostQuery::Filter::Base +class CostQuery::Filter::OverriddenCosts < Report::Filter::Base def self.label CostEntry.human_attribute_name(:overridden_costs) diff --git a/app/models/cost_query/filter/permission_filter.rb b/app/models/cost_query/filter/permission_filter.rb index c0954d705b..702ddb4402 100644 --- a/app/models/cost_query/filter/permission_filter.rb +++ b/app/models/cost_query/filter/permission_filter.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::PermissionFilter < CostQuery::Filter::Base +class CostQuery::Filter::PermissionFilter < Report::Filter::Base dont_display! not_selectable! db_field "" diff --git a/app/models/cost_query/filter/priority_id.rb b/app/models/cost_query/filter/priority_id.rb index 6a6de6f8b5..db647715a0 100644 --- a/app/models/cost_query/filter/priority_id.rb +++ b/app/models/cost_query/filter/priority_id.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::PriorityId < CostQuery::Filter::Base +class CostQuery::Filter::PriorityId < Report::Filter::Base join_table Issue applies_for :label_issue_attributes diff --git a/app/models/cost_query/filter/project_id.rb b/app/models/cost_query/filter/project_id.rb index 46549addc2..945c7bc3f4 100644 --- a/app/models/cost_query/filter/project_id.rb +++ b/app/models/cost_query/filter/project_id.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::ProjectId < CostQuery::Filter::Base +class CostQuery::Filter::ProjectId < Report::Filter::Base db_field "entries.project_id" def self.label diff --git a/app/models/cost_query/filter/spent_on.rb b/app/models/cost_query/filter/spent_on.rb index e8ff3287e0..acef1ee2e9 100644 --- a/app/models/cost_query/filter/spent_on.rb +++ b/app/models/cost_query/filter/spent_on.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::SpentOn < CostQuery::Filter::Base +class CostQuery::Filter::SpentOn < Report::Filter::Base use :time_operators def self.label diff --git a/app/models/cost_query/filter/start_date.rb b/app/models/cost_query/filter/start_date.rb index 2efd7c7ff8..7d7dc8a10f 100644 --- a/app/models/cost_query/filter/start_date.rb +++ b/app/models/cost_query/filter/start_date.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::StartDate < CostQuery::Filter::Base +class CostQuery::Filter::StartDate < Report::Filter::Base use :time_operators join_table Issue applies_for :label_issue_attributes diff --git a/app/models/cost_query/filter/status_id.rb b/app/models/cost_query/filter/status_id.rb index aafb49c71e..aaaf2f4ad1 100644 --- a/app/models/cost_query/filter/status_id.rb +++ b/app/models/cost_query/filter/status_id.rb @@ -1,6 +1,6 @@ #we have to require this here because the operators would not be defined otherwise require_dependency 'cost_query/operator' -class CostQuery::Filter::StatusId < CostQuery::Filter::Base +class CostQuery::Filter::StatusId < Report::Filter::Base available_operators 'c', 'o' join_table Issue, IssueStatus => [Issue, :status] applies_for :label_issue_attributes diff --git a/app/models/cost_query/filter/subject.rb b/app/models/cost_query/filter/subject.rb index 14da1636bf..c78e91491e 100644 --- a/app/models/cost_query/filter/subject.rb +++ b/app/models/cost_query/filter/subject.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::Subject < CostQuery::Filter::Base +class CostQuery::Filter::Subject < Report::Filter::Base use :string_operators join_table Issue applies_for :label_issue_attributes diff --git a/app/models/cost_query/filter/tmonth.rb b/app/models/cost_query/filter/tmonth.rb index 929b641d0f..1839a9606e 100644 --- a/app/models/cost_query/filter/tmonth.rb +++ b/app/models/cost_query/filter/tmonth.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::Tmonth < CostQuery::Filter::Base +class CostQuery::Filter::Tmonth < Report::Filter::Base use :integer_operators def self.label diff --git a/app/models/cost_query/filter/tracker_id.rb b/app/models/cost_query/filter/tracker_id.rb index c83af65b68..1063b794f0 100644 --- a/app/models/cost_query/filter/tracker_id.rb +++ b/app/models/cost_query/filter/tracker_id.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::TrackerId < CostQuery::Filter::Base +class CostQuery::Filter::TrackerId < Report::Filter::Base join_table Issue applies_for :label_issue_attributes diff --git a/app/models/cost_query/filter/tweek.rb b/app/models/cost_query/filter/tweek.rb index 439b716a9a..8f62a6c9e1 100644 --- a/app/models/cost_query/filter/tweek.rb +++ b/app/models/cost_query/filter/tweek.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::Tweek < CostQuery::Filter::Base +class CostQuery::Filter::Tweek < Report::Filter::Base use :integer_operators def self.label diff --git a/app/models/cost_query/filter/tyear.rb b/app/models/cost_query/filter/tyear.rb index 646aa31384..1845120e4f 100644 --- a/app/models/cost_query/filter/tyear.rb +++ b/app/models/cost_query/filter/tyear.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::Tyear < CostQuery::Filter::Base +class CostQuery::Filter::Tyear < Report::Filter::Base use :integer_operators def self.label diff --git a/app/models/cost_query/filter/updated_on.rb b/app/models/cost_query/filter/updated_on.rb index 72ce0b2004..9a6ec40c23 100644 --- a/app/models/cost_query/filter/updated_on.rb +++ b/app/models/cost_query/filter/updated_on.rb @@ -1,8 +1,8 @@ -class CostQuery::Filter::UpdatedOn < CostQuery::Filter::Base +class CostQuery::Filter::UpdatedOn < Report::Filter::Base db_field "entries.updated_on" use :time_operators def self.label Issue.human_attribute_name(:updated_on) end -end \ No newline at end of file +end diff --git a/app/models/cost_query/filter/user_id.rb b/app/models/cost_query/filter/user_id.rb index b34698135c..f6dff99bf3 100644 --- a/app/models/cost_query/filter/user_id.rb +++ b/app/models/cost_query/filter/user_id.rb @@ -1,4 +1,4 @@ -class CostQuery::Filter::UserId < CostQuery::Filter::Base +class CostQuery::Filter::UserId < Report::Filter::Base def self.label Issue.human_attribute_name(:user) end diff --git a/spec/models/cost_query/chaining_spec.rb b/spec/models/cost_query/chaining_spec.rb index 0728d9f7be..5e80d0a5dc 100644 --- a/spec/models/cost_query/chaining_spec.rb +++ b/spec/models/cost_query/chaining_spec.rb @@ -99,7 +99,7 @@ describe CostQuery, :reporting_query_helper => true do end it "should initialize the chain through a block" do - class TestFilter < CostQuery::Filter::Base + class TestFilter < Report::Filter::Base def self.engine CostQuery end @@ -250,7 +250,7 @@ describe CostQuery, :reporting_query_helper => true do describe :display do it "should give display? == false when a filter says dont_display!" do - class TestFilter < CostQuery::Filter::Base + class TestFilter < Report::Filter::Base dont_display! end TestFilter.display?.should be false @@ -258,14 +258,14 @@ describe CostQuery, :reporting_query_helper => true do end it "should give display? == true when a filter doesn't specify it's visibility" do - class TestFilter < CostQuery::Filter::Base + class TestFilter < Report::Filter::Base end TestFilter.display?.should be true Object.send(:remove_const, :TestFilter) end it "should give display? == true when a filter says display!" do - class TestFilter < CostQuery::Filter::Base + class TestFilter < Report::Filter::Base display! end TestFilter.display?.should be true @@ -275,7 +275,7 @@ describe CostQuery, :reporting_query_helper => true do describe :selectable do it "should give selectable? == false when a filter says not_selectable!" do - class TestFilter < CostQuery::Filter::Base + class TestFilter < Report::Filter::Base not_selectable! end TestFilter.selectable?.should be false @@ -283,14 +283,14 @@ describe CostQuery, :reporting_query_helper => true do end it "should give selectable? == true when a filter doesn't specify it's selectability" do - class TestFilter < CostQuery::Filter::Base + class TestFilter < Report::Filter::Base end TestFilter.selectable?.should be true Object.send(:remove_const, :TestFilter) end it "should give selectable? == true when a filter says selectable!" do - class TestFilter < CostQuery::Filter::Base + class TestFilter < Report::Filter::Base selectable! end TestFilter.selectable?.should be true