Last active
August 29, 2015 14:03
-
-
Save alxjrvs/be69ab1f2ee27f5b51d3 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
#If you are setting a custom folder for Carrierwave uploads and that folder structure relies on related objects, | |
# be sure that those related objects are already created before initializing the carrierwave object! | |
##This is bad | |
User.create( | |
username: "cosby", | |
avatar: Avatar.create(file: <a file>) | |
) | |
##This is Good | |
user = User.create(username: "cosby") | |
user.build_avatar(file: <a file>) | |
user.save |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment