Sha256: ec76c00455b9a4512378a61e86d41ff2a3b325b65b9d66278994cf0feca6e15d
Contents?: true
Size: 604 Bytes
Versions: 6
Compression:
Stored size: 604 Bytes
Contents
namespace :forgeos do namespace :core do desc 'copy attachments association table values into an unique table' task :attachments_migration => :environment do elements = [] << Product.all << User.all << Attribute.all << ProductType.all << Category.all << AttributeValue.all elements.flatten.each do |element| print "#{element.class} ##{element.id} : " element.attachments2 = element.attachments if element.save puts 'ok' else puts element.errors.inspect end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems