Skip to content

Instantly share code, notes, and snippets.

@dummied
Created January 25, 2010 22:01
Show Gist options
  • Save dummied/286304 to your computer and use it in GitHub Desktop.
Save dummied/286304 to your computer and use it in GitHub Desktop.
def self.bulk_update(ids, *args)
set = sanitize_sql_hash_for_assignment(args.extract_options!)
connection.execute("UPDATE #{self.table_name} SET #{set} WHERE id in (#{ids.join(",")})")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment