diff --git a/app/controllers/spree/api/base_controller.rb b/app/controllers/spree/api/base_controller.rb index 776fa118dc..c201128bf2 100644 --- a/app/controllers/spree/api/base_controller.rb +++ b/app/controllers/spree/api/base_controller.rb @@ -30,15 +30,6 @@ module Spree end end - def map_nested_attributes_keys(klass, attributes) - nested_keys = klass.nested_attributes_options.keys - attributes.inject({}) do |h, (k, v)| - key = nested_keys.include?(k.to_sym) ? "#{k}_attributes" : k - h[key] = v - h - end.with_indifferent_access - end - private def set_content_type diff --git a/spec/controllers/api/base_controller_spec.rb b/spec/controllers/api/base_controller_spec.rb index df44fb5d8e..9e31fc138e 100644 --- a/spec/controllers/api/base_controller_spec.rb +++ b/spec/controllers/api/base_controller_spec.rb @@ -61,16 +61,4 @@ describe Api::BaseController do expect(json_response).to eq( "error" => "The resource you were looking for could not be found." ) expect(response.status).to eq(404) end - - it "maps symantec keys to nested_attributes keys" do - klass = double(nested_attributes_options: { line_items: {}, - bill_address: {} }) - attributes = { 'line_items' => { id: 1 }, - 'bill_address' => { id: 2 }, - 'name' => 'test order' } - - mapped = subject.map_nested_attributes_keys(klass, attributes) - expect(mapped.key?('line_items_attributes')).to be_truthy - expect(mapped.key?('name')).to be_truthy - end end