Created
October 4, 2010 17:33
-
-
Save johnbeynon/610112 to your computer and use it in GitHub Desktop.
This file contains 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 PurgePostCategories < ActiveRecord::Migration | |
@posts = [3,6,9,10,11,14,15,19,23,24,38,40,42,65,66,70,71,103,106,107,108,109,197,198,199,200,201] | |
c = Category.find_by_title('Useful') | |
def self.up | |
@posts.each do |post| | |
Post.find(post).categories.delete(c) | |
end | |
end | |
def self.down | |
@posts.each do |post| | |
Post.find(post).categories << c | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment