mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Revert "Add Rails >= 5.0.beta3 JSON API params parsing" (#1751)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
module Rails5Shims
|
||||
module ControllerTests
|
||||
# https://github.com/rails/rails/blob/b217354/actionpack/lib/action_controller/test_case.rb
|
||||
REQUEST_KWARGS = [:params, :headers, :session, :flash, :method, :body, :xhr].freeze
|
||||
REQUEST_KWARGS = [:params, :session, :flash, :method, :body, :xhr].freeze
|
||||
|
||||
def get(path, *args)
|
||||
fold_kwargs!(args)
|
||||
@@ -30,12 +30,7 @@ module Rails5Shims
|
||||
return unless hash.respond_to?(:key)
|
||||
Rails5Shims::ControllerTests::REQUEST_KWARGS.each do |kwarg|
|
||||
next unless hash.key?(kwarg)
|
||||
value = hash.delete(kwarg)
|
||||
if value.is_a? String
|
||||
args.insert(0, value)
|
||||
else
|
||||
hash.merge! value
|
||||
end
|
||||
hash.merge! hash.delete(kwarg)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -49,5 +44,4 @@ module Rails5Shims
|
||||
end
|
||||
if Rails::VERSION::MAJOR < 5
|
||||
ActionController::TestCase.send :include, Rails5Shims::ControllerTests
|
||||
ActionDispatch::IntegrationTest.send :include, Rails5Shims::ControllerTests
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user