From 114895eb6bd57c58e35cd9b8afc1eebf7b3ec88c Mon Sep 17 00:00:00 2001 From: Konstantin Haase Date: Fri, 14 Jan 2011 12:52:08 +0100 Subject: [PATCH] cleanup --- app/models/cost_query/filter.rb | 5 ---- app/models/cost_query/filter/base.rb | 3 --- app/models/cost_query/filter/custom_field.rb | 25 ------------------- app/models/cost_query/group_by.rb | 1 - app/models/cost_query/group_by/base.rb | 3 --- .../cost_query/group_by/custom_field.rb | 7 ------ app/models/cost_query/operator.rb | 2 -- app/models/cost_query/query_utils.rb | 5 +--- app/models/cost_query/sql_statement.rb | 2 -- app/models/cost_query/table.rb | 4 +-- 10 files changed, 2 insertions(+), 55 deletions(-) delete mode 100644 app/models/cost_query/filter/base.rb delete mode 100644 app/models/cost_query/filter/custom_field.rb delete mode 100644 app/models/cost_query/group_by/base.rb delete mode 100644 app/models/cost_query/group_by/custom_field.rb diff --git a/app/models/cost_query/filter.rb b/app/models/cost_query/filter.rb index c27e8278ac..3cc78917ec 100644 --- a/app/models/cost_query/filter.rb +++ b/app/models/cost_query/filter.rb @@ -1,8 +1,6 @@ require "set" class CostQuery::Filter < Report::Filter - require_dependency 'cost_query/filter/base' - def self.all @all ||= super + Set[ CostQuery::Filter::ActivityId, @@ -22,9 +20,6 @@ class CostQuery::Filter < Report::Filter CostQuery::Filter::StatusId, CostQuery::Filter::Subject, CostQuery::Filter::TrackerId, - #CostQuery::Filter::Tweek, - #CostQuery::Filter::Tmonth, - #CostQuery::Filter::Tyear, CostQuery::Filter::UpdatedOn, CostQuery::Filter::UserId, CostQuery::Filter::PermissionFilter, diff --git a/app/models/cost_query/filter/base.rb b/app/models/cost_query/filter/base.rb deleted file mode 100644 index 3764f840bc..0000000000 --- a/app/models/cost_query/filter/base.rb +++ /dev/null @@ -1,3 +0,0 @@ -class CostQuery::Filter::Base < Report::Filter::Base - include CostQuery::QueryUtils -end diff --git a/app/models/cost_query/filter/custom_field.rb b/app/models/cost_query/filter/custom_field.rb deleted file mode 100644 index d6d741dbd8..0000000000 --- a/app/models/cost_query/filter/custom_field.rb +++ /dev/null @@ -1,25 +0,0 @@ -module CostQuery::Filter - class CustomField < Base - extend CostQuery::CustomFieldMixin - - on_prepare do - applies_for :label_issue_attributes - # redmine internals just suck - case custom_field.field_format - when 'string', 'text' then use :string_operators - when 'list' then use :null_operators - when 'date' then use :time_operators - when 'int', 'float' then use :integer_operators - when 'bool' - @possible_values = [['true', 't'], ['false', 'f']] - use :null_operators - else - fail "cannot handle #{custom_field.field_format.inspect}" - end - end - - def self.available_values(*) - @possible_values || custom_field.possible_values - end - end -end diff --git a/app/models/cost_query/group_by.rb b/app/models/cost_query/group_by.rb index d1d3f936a0..41faa2fa63 100644 --- a/app/models/cost_query/group_by.rb +++ b/app/models/cost_query/group_by.rb @@ -14,7 +14,6 @@ class CostQuery::GroupBy < Report::GroupBy CostQuery::GroupBy::SingletonValue, CostQuery::GroupBy::Tmonth, CostQuery::GroupBy::TrackerId, - #CostQuery::GroupBy::Tweek, CostQuery::GroupBy::Tyear, CostQuery::GroupBy::UserId, CostQuery::GroupBy::Week, 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 096c6c1d41..0000000000 --- a/app/models/cost_query/group_by/base.rb +++ /dev/null @@ -1,3 +0,0 @@ -class CostQuery::GroupBy::Base < Report::GroupBy::Base - include CostQuery::QueryUtils -end diff --git a/app/models/cost_query/group_by/custom_field.rb b/app/models/cost_query/group_by/custom_field.rb deleted file mode 100644 index ff91571bf7..0000000000 --- a/app/models/cost_query/group_by/custom_field.rb +++ /dev/null @@ -1,7 +0,0 @@ -module CostQuery::GroupBy - class CustomField < Base - applies_for :label_issue_attributes - extend CostQuery::CustomFieldMixin - on_prepare { group_fields table_name } - end -end diff --git a/app/models/cost_query/operator.rb b/app/models/cost_query/operator.rb index 5abe125f8f..14eb49af62 100644 --- a/app/models/cost_query/operator.rb +++ b/app/models/cost_query/operator.rb @@ -1,6 +1,4 @@ class CostQuery::Operator < Report::Operator - include CostQuery::QueryUtils - # Operators from Redmine new "c", :arity => 0 do def modify(query, field, *values) diff --git a/app/models/cost_query/query_utils.rb b/app/models/cost_query/query_utils.rb index 772d02a97d..8766baad20 100644 --- a/app/models/cost_query/query_utils.rb +++ b/app/models/cost_query/query_utils.rb @@ -29,9 +29,6 @@ module CostQuery::QueryUtils "'#{quote_string l(ident)}'" end - def self.included(klass) - super - klass.extend self - end + propagate! end diff --git a/app/models/cost_query/sql_statement.rb b/app/models/cost_query/sql_statement.rb index bcf7a1ff22..2070f4ef3c 100644 --- a/app/models/cost_query/sql_statement.rb +++ b/app/models/cost_query/sql_statement.rb @@ -1,6 +1,4 @@ class CostQuery::SqlStatement < Report::SqlStatement - include CostQuery::QueryUtils - COMMON_FIELDS = %w[ user_id project_id issue_id rate_id comments spent_on created_on updated_on tyear tmonth tweek diff --git a/app/models/cost_query/table.rb b/app/models/cost_query/table.rb index 8770aed15c..8f33a445a2 100644 --- a/app/models/cost_query/table.rb +++ b/app/models/cost_query/table.rb @@ -1,3 +1 @@ -class CostQuery::Table < Report::Table - include CostQuery::QueryUtils -end +class CostQuery::Table < Report::Table; end