Skip to content

Instantly share code, notes, and snippets.

@skojin
Created September 16, 2022 13:45
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 skojin/ebc3218c5c7c1b7bcf1eb0d9c2b7a1b6 to your computer and use it in GitHub Desktop.
Save skojin/ebc3218c5c7c1b7bcf1eb0d9c2b7a1b6 to your computer and use it in GitHub Desktop.
batch set enabled flag from table with checkboxes
current_account.items.update_all(['enabled = (SELECT id IN (?))', Array(params[:ids])])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment