Displaying 1 result from an estimated 1 matches for "synchronize_photos".
2006 Aug 11
1
Absolute path to public/images in rake task?
...o has its own Photo class
object). I''ve got so far:
# File tasks/photo_gallery.rake:
desc ''Synchronizes the photos of the galleries.''
task :synchronize_photo_galleries => :environment do
puts ''--- Beginning with synchronization ---''
PhotoGallery.synchronize_photos
puts ''--- Synchronization done ---''
end
# File app/models/photo_gallery.rb
class PhotoGallery < ActiveRecord::Base
# associations...
def self.synchronize_photos
photo_galleries = PhotoGallery.find :all
photo_galleries.each do | photo_gallery |
Dir.foreach(...