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. 2
      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. 2
      app/models/cost_query/filter/updated_on.rb
  25. 2
      app/models/cost_query/filter/user_id.rb
  26. 5
      app/models/cost_query/group_by/activity_id.rb
  27. 4
      app/models/cost_query/group_by/assigned_to_id.rb
  28. 4
      app/models/cost_query/group_by/author_id.rb
  29. 1
      app/models/cost_query/group_by/base.rb
  30. 4
      app/models/cost_query/group_by/category_id.rb
  31. 4
      app/models/cost_query/group_by/cost_object_id.rb
  32. 4
      app/models/cost_query/group_by/cost_type_id.rb
  33. 4
      app/models/cost_query/group_by/custom_field_entries.rb
  34. 4
      app/models/cost_query/group_by/fixed_version_id.rb
  35. 4
      app/models/cost_query/group_by/issue_id.rb
  36. 4
      app/models/cost_query/group_by/priority_id.rb
  37. 4
      app/models/cost_query/group_by/project_id.rb
  38. 5
      app/models/cost_query/group_by/spent_on.rb
  39. 4
      app/models/cost_query/group_by/status_id.rb
  40. 4
      app/models/cost_query/group_by/tmonth.rb
  41. 4
      app/models/cost_query/group_by/tracker_id.rb
  42. 4
      app/models/cost_query/group_by/tweek.rb
  43. 4
      app/models/cost_query/group_by/tyear.rb
  44. 4
      app/models/cost_query/group_by/user_id.rb
  45. 5
      app/models/cost_query/group_by/week.rb
  46. 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 def self.label
TimeEntry.human_attribute_name(:activity) 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 use :null_operators
join_table Issue join_table Issue
applies_for :label_issue_attributes 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 join_table Issue
applies_for :label_issue_attributes 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 use :null_operators
join_table Issue join_table Issue
applies_for :label_issue_attributes 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 join_table Project
applies_for :label_issue_attributes 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 extra_options :display
selectable false selectable false

@ -1,4 +1,4 @@
class CostQuery::Filter::CreatedOn < CostQuery::Filter::Base class CostQuery::Filter::CreatedOn < Report::Filter::Base
db_field "entries.created_on" db_field "entries.created_on"
use :time_operators use :time_operators

@ -1,4 +1,4 @@
class CostQuery::Filter::DueDate < CostQuery::Filter::Base class CostQuery::Filter::DueDate < Report::Filter::Base
use :time_operators use :time_operators
join_table Issue join_table Issue
applies_for :label_issue_attributes 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 use :null_operators
join_table Issue join_table Issue
applies_for :label_issue_attributes 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 def self.label
Issue.model_name.human 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 def self.label
CostEntry.human_attribute_name(:overridden_costs) 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! dont_display!
not_selectable! not_selectable!
db_field "" db_field ""

@ -1,4 +1,4 @@
class CostQuery::Filter::PriorityId < CostQuery::Filter::Base class CostQuery::Filter::PriorityId < Report::Filter::Base
join_table Issue join_table Issue
applies_for :label_issue_attributes 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" db_field "entries.project_id"
def self.label def self.label

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

@ -1,4 +1,4 @@
class CostQuery::Filter::StartDate < CostQuery::Filter::Base class CostQuery::Filter::StartDate < Report::Filter::Base
use :time_operators use :time_operators
join_table Issue join_table Issue
applies_for :label_issue_attributes applies_for :label_issue_attributes

@ -1,6 +1,6 @@
#we have to require this here because the operators would not be defined otherwise #we have to require this here because the operators would not be defined otherwise
require_dependency 'cost_query/operator' require_dependency 'cost_query/operator'
class CostQuery::Filter::StatusId < CostQuery::Filter::Base class CostQuery::Filter::StatusId < Report::Filter::Base
available_operators 'c', 'o' available_operators 'c', 'o'
join_table Issue, IssueStatus => [Issue, :status] join_table Issue, IssueStatus => [Issue, :status]
applies_for :label_issue_attributes 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 use :string_operators
join_table Issue join_table Issue
applies_for :label_issue_attributes 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 use :integer_operators
def self.label def self.label

@ -1,4 +1,4 @@
class CostQuery::Filter::TrackerId < CostQuery::Filter::Base class CostQuery::Filter::TrackerId < Report::Filter::Base
join_table Issue join_table Issue
applies_for :label_issue_attributes 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 use :integer_operators
def self.label def self.label

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

@ -1,4 +1,4 @@
class CostQuery::Filter::UpdatedOn < CostQuery::Filter::Base class CostQuery::Filter::UpdatedOn < Report::Filter::Base
db_field "entries.updated_on" db_field "entries.updated_on"
use :time_operators use :time_operators

@ -1,4 +1,4 @@
class CostQuery::Filter::UserId < CostQuery::Filter::Base class CostQuery::Filter::UserId < Report::Filter::Base
def self.label def self.label
Issue.human_attribute_name(:user) Issue.human_attribute_name(:user)
end end

@ -1,8 +1,5 @@
class CostQuery::GroupBy class CostQuery::GroupBy::ActivityId < Report::GroupBy::Base
class ActivityId < Base
def self.label def self.label
TimeEntry.human_attribute_name(:activity) TimeEntry.human_attribute_name(:activity)
end end
end
end end

@ -1,10 +1,8 @@
class CostQuery::GroupBy class CostQuery::GroupBy::AssignedToId < Report::GroupBy::Base
class AssignedToId < Base
join_table Issue join_table Issue
applies_for :label_issue_attributes applies_for :label_issue_attributes
def self.label def self.label
Issue.human_attribute_name(:assigned_to) Issue.human_attribute_name(:assigned_to)
end end
end
end end

@ -1,10 +1,8 @@
class CostQuery::GroupBy class CostQuery::GroupBy::AuthorId < Report::GroupBy::Base
class AuthorId < Base
join_table Issue join_table Issue
applies_for :label_issue_attributes applies_for :label_issue_attributes
def self.label def self.label
Issue.human_attribute_name(:author) Issue.human_attribute_name(:author)
end end
end
end end

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

@ -1,10 +1,8 @@
class CostQuery::GroupBy class CostQuery::GroupBy::CategoryId < Report::GroupBy::Base
class CategoryId < Base
join_table Issue join_table Issue
applies_for :label_issue_attributes applies_for :label_issue_attributes
def self.label def self.label
Issue.human_attribute_name(:category) Issue.human_attribute_name(:category)
end end
end
end end

@ -1,10 +1,8 @@
class CostQuery::GroupBy class CostQuery::GroupBy::CostObjectId < Report::GroupBy::Base
class CostObjectId < Base
join_table Issue join_table Issue
applies_for :label_issue_attributes applies_for :label_issue_attributes
def self.label def self.label
CostObject.model_name.human CostObject.model_name.human
end end
end
end end

@ -1,8 +1,6 @@
class CostQuery::GroupBy class CostQuery::GroupBy::CostTypeId < Report::GroupBy::Base
class CostTypeId < Base
def self.label def self.label
CostType.model_name.human CostType.model_name.human
end end
end
end end

@ -1,7 +1,5 @@
class CostQuery::GroupBy class CostQuery::GroupBy::CustomFieldEntries < Report::GroupBy::Base
class CustomFieldEntries < Base
applies_for :label_issue_attributes applies_for :label_issue_attributes
extend CostQuery::CustomFieldMixin extend CostQuery::CustomFieldMixin
on_prepare { group_fields table_name } on_prepare { group_fields table_name }
end
end end

@ -1,10 +1,8 @@
class CostQuery::GroupBy class CostQuery::GroupBy::FixedVersionId < Report::GroupBy::Base
class FixedVersionId < Base
join_table Issue join_table Issue
applies_for :label_issue_attributes applies_for :label_issue_attributes
def self.label def self.label
Issue.human_attribute_name(:fixed_version) Issue.human_attribute_name(:fixed_version)
end end
end
end end

@ -1,8 +1,6 @@
class CostQuery::GroupBy class CostQuery::GroupBy::IssueId < Report::GroupBy::Base
class IssueId < Base
def self.label def self.label
Issue.model_name.human Issue.model_name.human
end end
end
end end

@ -1,10 +1,8 @@
class CostQuery::GroupBy class CostQuery::GroupBy::PriorityId < Report::GroupBy::Base
class PriorityId < Base
join_table Issue join_table Issue
applies_for :label_issue_attributes applies_for :label_issue_attributes
def self.label def self.label
Issue.human_attribute_name(:priority) Issue.human_attribute_name(:priority)
end end
end
end end

@ -1,8 +1,6 @@
class CostQuery::GroupBy class CostQuery::GroupBy::ProjectId < Report::GroupBy::Base
class ProjectId < Base
def self.label def self.label
Project.model_name.human Project.model_name.human
end end
end
end end

@ -1,8 +1,5 @@
class CostQuery::GroupBy class CostQuery::GroupBy::SpentOn < Report::GroupBy::Base
class SpentOn < Base
def self.label def self.label
I18n.t(:label_spent_on_reporting) I18n.t(:label_spent_on_reporting)
end end
end
end end

@ -1,10 +1,8 @@
class CostQuery::GroupBy class CostQuery::GroupBy::StatusId < Report::GroupBy::Base
class StatusId < Base
join_table Issue join_table Issue
applies_for :label_issue_attributes applies_for :label_issue_attributes
def self.label def self.label
Issue.human_attribute_name(:status) Issue.human_attribute_name(:status)
end end
end
end end

@ -1,8 +1,6 @@
class CostQuery::GroupBy class CostQuery::GroupBy::Tmonth < Report::GroupBy::Base
class Tmonth < Base
def self.label def self.label
I18n.t(:label_month_reporting) I18n.t(:label_month_reporting)
end end
end
end end

@ -1,10 +1,8 @@
class CostQuery::GroupBy class CostQuery::GroupBy::TrackerId < Report::GroupBy::Base
class TrackerId < Base
join_table Issue join_table Issue
applies_for :label_issue_attributes applies_for :label_issue_attributes
def self.label def self.label
Issue.human_attribute_name(:tracker) Issue.human_attribute_name(:tracker)
end end
end
end end

@ -1,8 +1,6 @@
class CostQuery::GroupBy class CostQuery::GroupBy::Tweek < Report::GroupBy::Base
class Tweek < Base
def self.label def self.label
I18n.t(:label_week_reporting) I18n.t(:label_week_reporting)
end end
end
end end

@ -1,8 +1,6 @@
class CostQuery::GroupBy class CostQuery::GroupBy::Tyear < Report::GroupBy::Base
class Tyear < Base
def self.label def self.label
I18n.t(:label_year_reporting) I18n.t(:label_year_reporting)
end end
end
end end

@ -1,8 +1,6 @@
class CostQuery::GroupBy class CostQuery::GroupBy::UserId < Report::GroupBy::Base
class UserId < Base
def self.label def self.label
Issue.human_attribute_name(:user) Issue.human_attribute_name(:user)
end end
end
end end

@ -1,8 +1,5 @@
class CostQuery::GroupBy class CostQuery::GroupBy::Week < Report::GroupBy::Base
class Week < Base
def self.label def self.label
I18n.t(:label_week_reporting) I18n.t(:label_week_reporting)
end end
end
end end

@ -99,7 +99,7 @@ describe CostQuery, :reporting_query_helper => true do
end end
it "should initialize the chain through a block" do it "should initialize the chain through a block" do
class TestFilter < CostQuery::Filter::Base class TestFilter < Report::Filter::Base
def self.engine def self.engine
CostQuery CostQuery
end end
@ -250,7 +250,7 @@ describe CostQuery, :reporting_query_helper => true do
describe :display do describe :display do
it "should give display? == false when a filter says dont_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! dont_display!
end end
TestFilter.display?.should be false TestFilter.display?.should be false
@ -258,14 +258,14 @@ describe CostQuery, :reporting_query_helper => true do
end end
it "should give display? == true when a filter doesn't specify it's visibility" do 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 end
TestFilter.display?.should be true TestFilter.display?.should be true
Object.send(:remove_const, :TestFilter) Object.send(:remove_const, :TestFilter)
end end
it "should give display? == true when a filter says display!" do it "should give display? == true when a filter says display!" do
class TestFilter < CostQuery::Filter::Base class TestFilter < Report::Filter::Base
display! display!
end end
TestFilter.display?.should be true TestFilter.display?.should be true
@ -275,7 +275,7 @@ describe CostQuery, :reporting_query_helper => true do
describe :selectable do describe :selectable do
it "should give selectable? == false when a filter says not_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! not_selectable!
end end
TestFilter.selectable?.should be false TestFilter.selectable?.should be false
@ -283,14 +283,14 @@ describe CostQuery, :reporting_query_helper => true do
end end
it "should give selectable? == true when a filter doesn't specify it's selectability" do 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 end
TestFilter.selectable?.should be true TestFilter.selectable?.should be true
Object.send(:remove_const, :TestFilter) Object.send(:remove_const, :TestFilter)
end end
it "should give selectable? == true when a filter says selectable!" do it "should give selectable? == true when a filter says selectable!" do
class TestFilter < CostQuery::Filter::Base class TestFilter < Report::Filter::Base
selectable! selectable!
end end
TestFilter.selectable?.should be true TestFilter.selectable?.should be true

Loading…
Cancel
Save