-
-
Save geeky-sh/8035481 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
# want to nest `Video` under `Media`; had a `videos` collection | |
# rename the collection: | |
Mongoid.database.drop_collection('videos') | |
Mongoid.database.rename_collection('videos', 'media') | |
# or | |
Mongoid.database.collection('videos').rename('media') | |
# change the type of all the existing records | |
Media.update_all(_type: 'Video') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment