diff --git a/lib/json_api_client/resource.rb b/lib/json_api_client/resource.rb index 0665c99..321d1a2 100644 --- a/lib/json_api_client/resource.rb +++ b/lib/json_api_client/resource.rb @@ -365,11 +365,6 @@ def initialize(params = {}) setup_default_properties - self.class.associations.each do |association| - if params.has_key?(association.attr_name.to_s) - set_attribute(association.attr_name, params[association.attr_name.to_s]) - end - end self.request_params = self.class.request_params_class.new(self.class) end diff --git a/test/unit/resource_test.rb b/test/unit/resource_test.rb index 088bdff..70049af 100644 --- a/test/unit/resource_test.rb +++ b/test/unit/resource_test.rb @@ -88,6 +88,7 @@ def test_associations_as_params assert_equal(article.foo, 'bar') assert_equal({'type' => 'authors', 'id' => 1}, article.relationships.author) assert article.relationships.attribute_changed?(:author) + refute article.attributes.has_key?(:author) end def test_default_params_overrideable