Skip to content

Commit

Permalink
Try pluck, fallback to select and collect
Browse files Browse the repository at this point in the history
  • Loading branch information
sturgill committed Oct 24, 2012
1 parent 5ded81e commit 490a91a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/closure_tree/acts_as_tree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def without_self(scope)
end

def ids_from(scope)
scope.uniq.pluck(:id)
scope.try(:pluck, :id) || scope.select(:id).collect(&:id)
end


Expand Down

0 comments on commit 490a91a

Please sign in to comment.