Open Source Bridge/Technology/Combining Duplicate OCW Accounts

From Stumptown Syndicate
Jump to: navigation, search

It's relatively easy for users to create duplicate users in OCW if they sign in using multiple methods. Until we have a better system for managing this via the UI, we have to combine existing accounts using the Rails console. This process will move all associations (authentication info, proposals, favorites, etc) to a single canonical account. If both accounts have bio information, the person should update this manually.

# ssh to the OSB server
ssh arroway.stumptownsyndicate.org

# once there, start the rails console
sudo su osbridge-ocw
cd current
bundle exec rails console production

# in the rails console, get the primary account that should own everything (I usually go with the lowest user ID)
primary = OpenConferenceWare::User.find(<id from primary user profile URL>)
# …and find the duplicate
dupe = OpenConferenceWare::User.find(<id from primary user profile URL>)

primary.take_associations_from(dupe)