diff --git a/lib/ansible_tower_client/base_model.rb b/lib/ansible_tower_client/base_model.rb index 31a7136..a7f83ee 100644 --- a/lib/ansible_tower_client/base_model.rb +++ b/lib/ansible_tower_client/base_model.rb @@ -95,11 +95,7 @@ def update_attributes!(attributes) @api.patch(url, attributes.to_json) attributes.each do |method_name, value| invoke_name = "#{override_raw_attributes[method_name] || method_name}=" - if respond_to?(invoke_name) - send(invoke_name, value) - else - AnsibleTowerClient.logger.warn("Unknown attribute/method: #{invoke_name}. Skip updating it ...") - end + send(invoke_name, value) end true end diff --git a/spec/support/shared_examples/crud_methods.rb b/spec/support/shared_examples/crud_methods.rb index 267bcba..f65da30 100644 --- a/spec/support/shared_examples/crud_methods.rb +++ b/spec/support/shared_examples/crud_methods.rb @@ -37,12 +37,6 @@ expect(obj.name).to eq 'blah' end - it "ignore unknown attributes if patch succeeds" do - expect(instance_api).to receive(:patch).and_return(instance_double("Faraday::Result", :body => raw_instance.to_json)) - expect(obj.update_attributes!(:name => 'blah', :stranger_thing => 'bomb')).to eq true - expect(obj.name).to eq 'blah' - end - it "returns an error if an error is raised" do expect(instance_api).to receive(:patch).and_raise(AnsibleTowerClient::Error, 'error') expect { obj.update_attributes!(:name => 'bad name') }.to raise_error(AnsibleTowerClient::Error)