Ticket #19639: don't use Chainable#field in our session, as it may delegate to db_field and consequently brakes const lookup in Controller#build_query

pull/6827/head
jwollert 14 years ago
parent 3f749fa8cd
commit 8582de210f
  1. 6
      lib/report/controller.rb

@ -286,11 +286,11 @@ module Report::Controller
def store_query(query)
cookie = {}
cookie[:groups] = @query.group_bys.inject({}) do |h, group|
((h[:"#{group.type}s"] ||= []) << group.field.to_sym) && h
((h[:"#{group.type}s"] ||= []) << group.underscore_name.to_sym) && h
end
cookie[:filters] = @query.filters.inject({:operators => {}, :values => {}}) do |h, filter|
h[:operators][filter.field.to_sym] = filter.operator.to_s
h[:values][filter.field.to_sym] = filter.values
h[:operators][filter.underscore_name.to_sym] = filter.operator.to_s
h[:values][filter.underscore_name.to_sym] = filter.values
h
end
cookie[:name] = @query.name if @query.name

Loading…
Cancel
Save