Merge pull request #27 from finnlabs/feature/rails3_fix_development_classloading

Fixed uninitialized constant exception in development
pull/6827/head
Christian Rijke 12 years ago
commit 7355abac66
  1. 38
      app/models/cost_query/filter/custom_field_entries.rb

@ -1,25 +1,23 @@
class CostQuery::Filter
class CustomFieldEntries < Base
extend CostQuery::CustomFieldMixin
class CostQuery::Filter::CustomFieldEntries < Report::Filter::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
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
def self.available_values(*)
@possible_values || custom_field.possible_values
end
end

Loading…
Cancel
Save