Reputation: 96897
I have a model Idea
which has_attached_file :file1
and has_attached_file :file2
. For development purposes, I have a "bootstrap" task which is responsible of creating some initial objects ( just so that you don't have to create a user, then upload some files each and every time we delete the sqlite file ). How should I do this from a Rake task?
Upvotes: 3
Views: 919
Reputation: 23770
Try:
Idea.new(
:name => 'bla',
:file1 => File.open('/some/path/to.file'),
:file2 => File.open('/some/path/to.file')
)
Upvotes: 4