Skip to content

Instantly share code, notes, and snippets.

@aharpole
Created April 10, 2013 19:25
Show Gist options
  • Save aharpole/5357667 to your computer and use it in GitHub Desktop.
Save aharpole/5357667 to your computer and use it in GitHub Desktop.
an example of using an ActiveRecord transaction
ActiveRecord::Base.transaction do
PlaylistSong.delete(playlist_id:params[:playlist_id])
#<create the new PlaylistSong objects
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment