Skip to content

Instantly share code, notes, and snippets.

@bradgessler
Created December 3, 2009 00:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradgessler/247788 to your computer and use it in GitHub Desktop.
Save bradgessler/247788 to your computer and use it in GitHub Desktop.
ActiveRecord::Base.connection.execute %{
UPDATE memberships, accounts
SET memberships.is_owner = true
WHERE memberships.user_id = accounts.owner_id AND memberships.is_user = true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment