Sha256: 9c87fce992c8f65b5b949a6bc69bc3d6559435e74684e0341dff6f9a4103ae9f

Contents?: true

Size: 371 Bytes

Versions: 13

Compression:

Stored size: 371 Bytes

Contents

module JsonApiClient
  module Associations
    module HasOne
      class Association < BaseAssociation
        def from_result_set(result_set)
          result_set.first
        end

        def load_records(data)
          record_class = Utils.compute_type(klass, data["type"].classify)
          record_class.load id: data["id"]
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
json_api_client-1.17.1 lib/json_api_client/associations/has_one.rb
json_api_client-1.17.0 lib/json_api_client/associations/has_one.rb
json_api_client-1.16.1 lib/json_api_client/associations/has_one.rb
json_api_client-1.16.0 lib/json_api_client/associations/has_one.rb
json_api_client-1.15.0 lib/json_api_client/associations/has_one.rb
json_api_client-1.14.1 lib/json_api_client/associations/has_one.rb
json_api_client-1.14.0 lib/json_api_client/associations/has_one.rb
json_api_client-1.13.0 lib/json_api_client/associations/has_one.rb
json_api_client-1.12.2 lib/json_api_client/associations/has_one.rb
json_api_client-1.12.1 lib/json_api_client/associations/has_one.rb
json_api_client-1.12.0 lib/json_api_client/associations/has_one.rb
json_api_client-1.11.0 lib/json_api_client/associations/has_one.rb
json_api_client-1.10.0 lib/json_api_client/associations/has_one.rb