Fixed constant lookup issue with generated subclasses.

git-svn-id: https://dev.finn.de/svn/cockpit/branches/reporting_merge@1796 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
rkh 14 years ago
parent 8ec2d6877b
commit cec4fbb88e
  1. 2
      app/controllers/cost_reports_controller.rb
  2. 2
      app/models/cost_query/custom_field_mixin.rb

@ -1,7 +1,7 @@
class CostReportsController < ApplicationController
before_filter :load_all
before_filter :find_optional_project, :only => [:index]
before_filter :generate_query, :only => [:index]
before_filter :load_all
before_filter :set_cost_types, :only => [:index]
helper :reporting

@ -22,7 +22,7 @@ module CostQuery::CustomFieldMixin
def generate_subclasses
IssueCustomField.all.map do |field|
class_name = class_name_for field.name
parent.send(:remove_const, class_name) if CostQuery::GroupBy.const_defined? class_name
parent.send(:remove_const, class_name) if parent.const_defined? class_name
parent.const_set class_name, Class.new(self).prepare(field, class_name)
end
end

Loading…
Cancel
Save