From 21766479adb3064ef2d05fc8ff96838fb6d2b2d6 Mon Sep 17 00:00:00 2001 From: Xavi G Date: Mon, 21 Nov 2016 21:00:22 -0600 Subject: [PATCH] Underscore incoming params before filtering --- lib/active_model_serializers/adapter/json_api/deserialization.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/active_model_serializers/adapter/json_api/deserialization.rb b/lib/active_model_serializers/adapter/json_api/deserialization.rb index 2e0e531dd..500dae79d 100644 --- a/lib/active_model_serializers/adapter/json_api/deserialization.rb +++ b/lib/active_model_serializers/adapter/json_api/deserialization.rb @@ -141,6 +141,7 @@ def validate_payload(payload) # @api private def filter_fields(fields, options) + KeyTransform.send(:underscore, fields) if (only = options[:only]) fields.slice!(*Array(only).map(&:to_s)) elsif (except = options[:except])