I know you already aware of the support of pluck method in RoR and ActiveRecord. Using it you can pluck the values of an array column (or a table column) by its name.

Recently I discovered that we can pluck the column by its index too. It won’t work in the ActiveRecord. Since it doesn’t support neither array of hashes nor array of objects. But you can use it in the array of arrays like in the below example.

arr = [
        ["Foo1", "Bar1", "1", "W"],
        ["Foo2", "Bar2", "2", "X"],
        ["Foo3", "Bar3", "3", "Y"],
        ["Foo4", "Bar4", "4", "Z"]
=> ["1", "2", "3", "4"]

We can achieve the same using arr.map(&:third) method too.