Sha256: 189e7a75972959347b3bbe10792b6c6693a77032a68ce7c8cfe261f79297a990
Contents?: true
Size: 498 Bytes
Versions: 19
Compression:
Stored size: 498 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
19 entries across 19 versions & 1 rubygems