Skip to content

Commit 490a91a

Browse files
committed
Try pluck, fallback to select and collect
1 parent 5ded81e commit 490a91a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/closure_tree/acts_as_tree.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def without_self(scope)
352352
end
353353

354354
def ids_from(scope)
355-
scope.uniq.pluck(:id)
355+
scope.try(:pluck, :id) || scope.select(:id).collect(&:id)
356356
end
357357

358358

0 commit comments

Comments
 (0)