Skip to content

Commit

Permalink
Cleanup #163
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Aug 30, 2023
1 parent 224e127 commit d935131
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/global_id/locator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ def locate_many(gids, options = {})
end

records_by_model_name_and_id = {}
ids_by_model.each do |model, ids|

ids_by_model.each do |model, ids|
records = find_records(model, ids, ignore_missing: options[:ignore_missing])

records_by_id = records.index_by do |record|
Expand All @@ -164,12 +164,8 @@ def find_records(model_class, ids, options)
end
end

private
def model_id_is_valid?(gid)
primary_key = Array(gid.model_class.primary_key)
primary_key_size = primary_key.size

Array(gid.model_id).size == primary_key_size
Array(gid.model_id).size == Array(gid.model_class.primary_key).size
end
end

Expand Down

0 comments on commit d935131

Please sign in to comment.