Can .pluck
be used to get say only the first 5 values
e.g.
CategoryItemKey.where(category_id: @category.id).pluck(:name)
I only want the first 5 names. Also if there are only 3 names it wont throw an error it will just grab 3.
Cant see it in the docs or from a google search. How would I accomplish this?
CategoryItemKey.where(category_id: @category.id).pluck(:name)[0...5]