I'm trying to get all my user's email from the production rails console. Problem is the emails are being cut off when they are long:
User.select('email').where(:guest => false)
#<User email: "app+11rmqcgg9q.1d74111.6c2e294218ddadfff033de3f5bb3...">
How can I run the command in rails c and not have rails truncate the output? I just want a CSV of emails.
It's the output of inspect. So overriding it should be enough. If you care only about the emails in that situation you could actually get it like:
User.where(:guest => false).map(&:email)
puts User.select('email').where(:guest => false).map(&:email).join("\n")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With