Let\'s say that I have a User model with attributes :id, :first_name, :last_name, and :email. In my application, guest users shouldn\'t see User\
User
:id, :first_name, :last_name, and :email
User\
Try this:
User.where(id: 5).pluck(:id, :first_name)
it returns array containing id and first_name values