Sha256: d912666c71ae7bee16d9f890129eab192844d6ee012496a2ddf598c0072ae0a0
Contents?: true
Size: 478 Bytes
Versions: 13
Compression:
Stored size: 478 Bytes
Contents
namespace :attached do desc "Process a given 'model' and 'attachment'" task :process, [:model, :attachment] => :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! instance.send(attachment).save end end end
Version data entries
13 entries across 13 versions & 1 rubygems