Sha256: 3a528fdaca33ad9430444b2ac82f86aec58f6ecca0a67671dbab8ec0a02a878e

Contents?: true

Size: 255 Bytes

Versions: 4

Compression:

Stored size: 255 Bytes

Contents

class RecordLoader < GraphQL::Batch::Loader
  def initialize(model)
    @model = model
  end

  def perform(ids)
    @model.where(id: ids).each { |record| fulfill(record.id, record) }
    ids.each { |id| fulfill(id, nil) unless fulfilled?(id) }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
souls-0.24.2 apps/api/app/utils/record_loader.rb
souls-0.24.1 apps/api/app/utils/record_loader.rb
souls-0.22.8 hoy/app/utils/record_loader.rb
souls-0.22.7 hoy/app/utils/record_loader.rb