Sha256: 994ffb7c1672dd051b3bb4052df9070ebc6030b91dbf3e1593ebe339ec59a01e

Contents?: true

Size: 468 Bytes

Versions: 13

Compression:

Stored size: 468 Bytes

Contents

namespace :attached do
  
  desc "Process a given 'model' and 'attachment'."
  task :process, :model, :attachment, :needs => :environment do |t, args|
    
    model = args[:model] or raise "must specify model"
    attachment = args[:attachment] or raise "must specify attachment"
    
    klass = model.camelize.constantize or raise "invalid model '#{model}'"
    
    klass.all.each do |instance|
      instance.send(attachment).reprocess!
    end
    
  end
  
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
attached-0.3.1 lib/tasks/attached.rake
attached-0.3.0 lib/tasks/attached.rake
attached-0.2.9 lib/tasks/attached.rake
attached-0.2.8 lib/tasks/attached.rake
attached-0.2.7 lib/tasks/attached.rake
attached-0.2.6 lib/tasks/attached.rake
attached-0.2.5 lib/tasks/attached.rake
attached-0.2.4 lib/tasks/attached.rake
attached-0.2.3 lib/tasks/attached.rake
attached-0.2.2 lib/tasks/attached.rake
attached-0.2.1 lib/tasks/attached.rake
attached-0.2.0 lib/tasks/attached.rake
attached-0.1.9 lib/tasks/attached.rake