Sha256: d018e0c2c7dffc4a63ffa215bdddb17a924a2b333618716be23a44cc308260a1

Contents?: true

Size: 401 Bytes

Versions: 8

Compression:

Stored size: 401 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, klass.key_formatter.unformat(data["type"]).classify)
          record_class.load id: data["id"]
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
json_api_client-1.23.0 lib/json_api_client/associations/has_one.rb
json_api_client-1.22.0 lib/json_api_client/associations/has_one.rb
json_api_client-1.21.1 lib/json_api_client/associations/has_one.rb
json_api_client-1.21.0 lib/json_api_client/associations/has_one.rb
json_api_client-1.20.0 lib/json_api_client/associations/has_one.rb
json_api_client-1.19.0 lib/json_api_client/associations/has_one.rb
carwow-json_api_client-1.19.0 lib/json_api_client/associations/has_one.rb
json_api_client-1.18.0 lib/json_api_client/associations/has_one.rb