custom_field drilldown fix now without introducing new bugs. nice

git-svn-id: https://dev.finn.de/svn/cockpit/branches/reporting_merge@1830 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
j.wollert 14 years ago
parent 9ed95fa8aa
commit 978cf0bf50
  1. 2
      app/models/cost_query.rb
  2. 6
      app/models/cost_query/custom_field_mixin.rb

@ -29,7 +29,7 @@ class CostQuery < ActiveRecord::Base
end
def add_chain(type, name, options)
chain type.const_get(name.to_s.camelcase.singularize), options
chain type.const_get(name.to_s.camelcase), options
@transformer, @table, @depths, @walker = nil, nil, nil, nil
self
end

@ -38,10 +38,14 @@ module CostQuery::CustomFieldMixin
@on_prepare
end
def table_name
@class_name.demodulize.underscore.tableize.singularize
end
def prepare(field, class_name)
@custom_field = field
label field.name
table_name(class_name.demodulize.underscore.tableize)
@class_name = class_name
dont_inherit :group_fields
db_field table_name
join_table (<<-SQL % [CustomValue.table_name, table_name, field.id, field.name, SQL_TYPES[field.field_format]]).gsub(/^ /, "")

Loading…
Cancel
Save