If I do User.all.pluck(:email) then it works fine.
But if I do
arr = Array.new
arr = User.all
and then
arr.pluck(:email)
this is raising following error
undefined method `pluck' for #<Array:0x007f4ff8daf3c8>
which means I cannot use pluck with arrays, so how can we get particular field value from an array of records in just one line like above. I don't want to loop through each record in an array.
User.all.pluck(:email)works fine? what rails version are you using?