Merge pull request #26 from finnlabs/fix-groupby-subclass-loading

[OPF #997, #1005] Fix groupby subclass loading
pull/6827/head
sschu 12 years ago
commit 2e7890968f
  1. 2
      app/models/cost_query/filter/activity_id.rb
  2. 2
      app/models/cost_query/filter/assigned_to_id.rb
  3. 2
      app/models/cost_query/filter/author_id.rb
  4. 1
      app/models/cost_query/filter/base.rb
  5. 2
      app/models/cost_query/filter/category_id.rb
  6. 2
      app/models/cost_query/filter/cost_object_id.rb
  7. 2
      app/models/cost_query/filter/cost_type_id.rb
  8. 4
      app/models/cost_query/filter/created_on.rb
  9. 2
      app/models/cost_query/filter/due_date.rb
  10. 2
      app/models/cost_query/filter/fixed_version_id.rb
  11. 2
      app/models/cost_query/filter/issue_id.rb
  12. 2
      app/models/cost_query/filter/overridden_costs.rb
  13. 2
      app/models/cost_query/filter/permission_filter.rb
  14. 2
      app/models/cost_query/filter/priority_id.rb
  15. 2
      app/models/cost_query/filter/project_id.rb
  16. 2
      app/models/cost_query/filter/spent_on.rb
  17. 2
      app/models/cost_query/filter/start_date.rb
  18. 2
      app/models/cost_query/filter/status_id.rb
  19. 2
      app/models/cost_query/filter/subject.rb
  20. 2
      app/models/cost_query/filter/tmonth.rb
  21. 2
      app/models/cost_query/filter/tracker_id.rb
  22. 2
      app/models/cost_query/filter/tweek.rb
  23. 2
      app/models/cost_query/filter/tyear.rb
  24. 4
      app/models/cost_query/filter/updated_on.rb
  25. 2
      app/models/cost_query/filter/user_id.rb
  26. 9
      app/models/cost_query/group_by/activity_id.rb
  27. 12
      app/models/cost_query/group_by/assigned_to_id.rb
  28. 12
      app/models/cost_query/group_by/author_id.rb
  29. 1
      app/models/cost_query/group_by/base.rb
  30. 12
      app/models/cost_query/group_by/category_id.rb
  31. 12
      app/models/cost_query/group_by/cost_object_id.rb
  32. 8
      app/models/cost_query/group_by/cost_type_id.rb
  33. 10
      app/models/cost_query/group_by/custom_field_entries.rb
  34. 12
      app/models/cost_query/group_by/fixed_version_id.rb
  35. 8
      app/models/cost_query/group_by/issue_id.rb
  36. 12
      app/models/cost_query/group_by/priority_id.rb
  37. 8
      app/models/cost_query/group_by/project_id.rb
  38. 2
      app/models/cost_query/group_by/ruby_aggregation.rb
  39. 9
      app/models/cost_query/group_by/spent_on.rb
  40. 12
      app/models/cost_query/group_by/status_id.rb
  41. 8
      app/models/cost_query/group_by/tmonth.rb
  42. 12
      app/models/cost_query/group_by/tracker_id.rb
  43. 8
      app/models/cost_query/group_by/tweek.rb
  44. 8
      app/models/cost_query/group_by/tyear.rb
  45. 8
      app/models/cost_query/group_by/user_id.rb
  46. 9
      app/models/cost_query/group_by/week.rb
  47. 14
      spec/models/cost_query/chaining_spec.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)

@ -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

@ -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

@ -1 +0,0 @@
class CostQuery::Filter::Base < Report::Filter::Base; end

@ -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

@ -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

@ -1,4 +1,4 @@
class CostQuery::Filter::CostTypeId < CostQuery::Filter::Base
class CostQuery::Filter::CostTypeId < Report::Filter::Base
extra_options :display
selectable false

@ -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
end

@ -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

@ -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

@ -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

@ -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)

@ -1,4 +1,4 @@
class CostQuery::Filter::PermissionFilter < CostQuery::Filter::Base
class CostQuery::Filter::PermissionFilter < Report::Filter::Base
dont_display!
not_selectable!
db_field ""

@ -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

@ -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

@ -1,4 +1,4 @@
class CostQuery::Filter::SpentOn < CostQuery::Filter::Base
class CostQuery::Filter::SpentOn < Report::Filter::Base
use :time_operators
def self.label

@ -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

@ -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

@ -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

@ -1,4 +1,4 @@
class CostQuery::Filter::Tmonth < CostQuery::Filter::Base
class CostQuery::Filter::Tmonth < Report::Filter::Base
use :integer_operators
def self.label

@ -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

@ -1,4 +1,4 @@
class CostQuery::Filter::Tweek < CostQuery::Filter::Base
class CostQuery::Filter::Tweek < Report::Filter::Base
use :integer_operators
def self.label

@ -1,4 +1,4 @@
class CostQuery::Filter::Tyear < CostQuery::Filter::Base
class CostQuery::Filter::Tyear < Report::Filter::Base
use :integer_operators
def self.label

@ -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
end

@ -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

@ -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

@ -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

@ -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

@ -1 +0,0 @@
class CostQuery::GroupBy::Base < Report::GroupBy::Base; end

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -10,4 +10,4 @@ class CostQuery::GroupBy
child.result.grouped_by(all_group_fields(false), type, group_fields)
end
end
end
end

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

Loading…
Cancel
Save