Last active
December 11, 2017 18:57
-
-
Save delkopiso/0a2422907354bd4ddd47f2960a7d3a92 to your computer and use it in GitHub Desktop.
use and misuse of rails migrations
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
class UndoAccidentalFlagging < ActiveRecord::Migration[5.1] | |
def change | |
unfortunate_comment_id = 1234 | |
unfortunate_user_id = 5678 | |
flag = ::Flag.find_by(comment_id: unfortunate_comment_id, user_id: unfortunate_user_id) | |
flag.destroy! | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment