Created
July 10, 2016 23:28
-
-
Save acuppy/4eb4fe721ae86bf31a501a4bd9850e8f to your computer and use it in GitHub Desktop.
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 AddCategoriesToPosts < ActiveRecord::Migration | |
# Fill the void | |
class ::Category < ActiveRecord::Base | |
end unless defined? ::Category | |
def change | |
Post.find_each do |p| | |
p.categories.create | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment