I have a rake task to seed an application with random data using the faker gem. However, we also have images (like logos) that we want uploaded in this rake task.
We already have Paperclip set up, but don’t have a way to upload them programmatically in a rake task. Any ideas?
What do you mean by programmatically? You can set up a method that will take a file path along the lines of
#attachmentcomes from our Paperclip declaration in our model. In this case, our model looks likeWe’ve done things similar to this when bootstrapping a project.