Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Rails Console Commands

matthewrknoll edited this page Mar 30, 2017 · 1 revision

Rails Console Commands

The Rails Console gives you superpowers that aren’t available in the usual OneBody UI. The commands below have been tested by me. They worked for me. They should work for you, too. You’ll need to run the onebody run rails console command as a user with root privileges. Putting a sudo in front of it as a regular user will work just fine, too.

When you’re done in the console, simply type exit then hit enter to get out.

Proceed with caution.

Delete All Users

onebody run rails console
Person.destroy_all

Make All Users Active (And Visible in the Directory)

onebody run rails console
Person.find_each { |p| p.status = :active; p.save }

Make Every User’s Email Address Visible in Directory

onebody run rails console
Person.update_all(share_email: true)