Remove superfluous filters

pull/6827/head
Alexander Bach 10 years ago
parent 05c0225b70
commit 31873b8a77
  1. 4
      app/controllers/cost_reports_controller.rb

@ -169,6 +169,10 @@ class CostReportsController < ApplicationController
# sets the @cost_type -> this is used to select the proper units for display
def set_cost_type
if @query
existing_filter = @query.filters.detect { |f| f.is_a?(CostQuery::Filter::CostTypeId) }
if existing_filter
@query.remove_filter(existing_filter)
end
@query.filter :cost_type_id, operator: '=', value: @unit_id.to_s, display: false
@cost_type = CostType.find(@unit_id) if @unit_id > 0
end

Loading…
Cancel
Save