diff --git a/core/config/initializers/json_api_client.rb b/core/config/initializers/json_api_client.rb deleted file mode 100644 index dfb22a526..000000000 --- a/core/config/initializers/json_api_client.rb +++ /dev/null @@ -1,2 +0,0 @@ -# MonkeyPatching json_api_client, see: https://github.com/chingor13/json_api_client/pull/263 -JsonApiClient::Resource.include JsonApiClientExtension::ResourceExtension diff --git a/core/lib/json_api_client_extension/resource_extension.rb b/core/lib/json_api_client_extension/resource_extension.rb deleted file mode 100644 index c1e8c7bdd..000000000 --- a/core/lib/json_api_client_extension/resource_extension.rb +++ /dev/null @@ -1,23 +0,0 @@ -# MonkeyPatching json_api_client, see: https://github.com/chingor13/json_api_client/pull/263 -module JsonApiClientExtension::ResourceExtension - extend ActiveSupport::Concern - - included do - def initialize(params = {}) - @persisted = nil - self.links = self.class.linker.new(params.delete("links") || {}) - self.relationships = self.class.relationship_linker.new(self.class, params.delete("relationships") || {}) - self.attributes = params.merge(self.class.default_attributes) - - self.class.schema.each_property do |property| - attributes[property.name] = property.default unless attributes.has_key?(property.name) || property.default.nil? - end - - 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 - end - end -end