Here are two sample codes.
First one with collect
:
User.first.gifts.collect(&:id)
Second one with pluck
:
User.first.gifts.pluck(:id)
Is there any difference between them in performance or something else?
Here are two sample codes.
First one with collect
:
User.first.gifts.collect(&:id)
Second one with pluck
:
User.first.gifts.pluck(:id)
Is there any difference between them in performance or something else?