User.where(:role => :admin).order(:username).pluck(:email) #=> [admin1@example.com, admin2@example.com]
Created
May 12, 2014 08:23
-
-
Save qcam/5a3e39d135ed619b7e65 to your computer and use it in GitHub Desktop.
[Active Record] How to get a single column's values into an array
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment