Created
April 10, 2013 19:25
-
-
Save aharpole/5357667 to your computer and use it in GitHub Desktop.
an example of using an ActiveRecord transaction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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