Skip to content

Commit

Permalink
Use action dispatch filter to support nested filters and other rails …
Browse files Browse the repository at this point in the history
…5 features.
  • Loading branch information
rposborne committed May 26, 2017
1 parent d1058a0 commit b59f640
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/impressionist_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def impressionist_subapp_filter(opts = {})

# creates a statment hash that contains default values for creating an impression via an AR relation.
def associative_create_statement(query_params={})
filter = ActionDispatch::Http::ParameterFilter.new(Rails.application.config.filter_parameters)
query_params.reverse_merge!(
:controller_name => controller_name,
:action_name => action_name,
Expand All @@ -59,7 +60,7 @@ def associative_create_statement(query_params={})
:session_hash => session_hash,
:ip_address => request.remote_ip,
:referrer => request.referer,
:params => params_hash.except(Rails.application.config.filter_parameters)
:params => filter.filter(params_hash)
)
end

Expand Down

0 comments on commit b59f640

Please sign in to comment.