I've been studying the web this morning and trying to find examples
where someone has imported photo 'test data' using attachment_fu?
I've tried this in many was using a traditional data migration like
I've done hundreds of times and nothing comes in? Attachment_fu put a
record to the database, but there is so supporting file behind it.
I enclose what my migration looks like for one record.
newrecord = Vendphoto.create(
:vendor_id => '1',
:title => 'Add Test Vendphoto 1',
:content_type => 'image/jpeg',
:size => '38414',
:width => '230',
:height => '200',
:geo_lat => '27.9686',
:geo_long => '-97.0943',
:filename => 'KathyTest.jpg')
newrecord.save!
I 'presumed' some of this information by manually adding a photo and
then looking at the MySQL record that was created. I experimented
putting the photo in question 'KathyTest.jpg' in the \public\images
and many other places. I load the 'Vendphoto' record in the database
BUT the actual photo doesn't exist in my \Public\Images\Vendphoto (as
if I had done this manuall).
Thank you,
Kathy
KathysKode@gmail.com
Jodi,
I'm so excited about having the ability to load photos with
migrations! Thank you for responding. I took your code and modified my
original routine as shown:
The problem is a I get a "rake aborted! uninitialized constant
ActionController::TestUploadedFile " message when I try to run the
migration. Any suggestions are greatly appreciated.
Kathleen