Skip to content

Instantly share code, notes, and snippets.

@bradgessler
Created December 3, 2009 00:54
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/247792 to your computer and use it in GitHub Desktop.
Save bradgessler/247792 to your computer and use it in GitHub Desktop.
ActiveRecord::Base.connection.execute <<-SQL
UPDATE memberships, accounts
SET memberships.is_owner = true
WHERE memberships.user_id = accounts.owner_id AND memberships.is_user = true
SQL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment