Skip to content

Commit 469d452

Browse files
Merge pull request #1225 from tommy-russoniello/remove-unnecessary-distinct
Remove unnecessary `distinct` from query in `Resource::find_fragments`
2 parents d7f2543 + 0fed6d8 commit 469d452

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/jsonapi/active_relation_resource_finder.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def find_fragments(filters, options = {})
149149
end
150150

151151
fragments = {}
152-
rows = records.distinct.pluck(*pluck_fields)
152+
rows = records.pluck(*pluck_fields)
153153
rows.collect do |row|
154154
rid = JSONAPI::ResourceIdentity.new(resource_klass, pluck_fields.length == 1 ? row : row[0])
155155

@@ -777,4 +777,4 @@ def apply_filter(records, filter, value, options = {})
777777
end
778778
end
779779
end
780-
end
780+
end

0 commit comments

Comments
 (0)