Sha256: a4839d1c6502beb241de1e2a926392a2661f8218d4652e933132016b06e4af18
Contents?: true
Size: 1.62 KB
Versions: 12
Compression:
Stored size: 1.62 KB
Contents
namespace :radiant do namespace :extensions do namespace :concurrent_draft do desc "Runs the migration of the ConcurrentDraft extension" task :migrate => :environment do require 'radiant/extension_migrator' if ENV["VERSION"] ConcurrentDraftExtension.migrator.migrate(ENV["VERSION"].to_i) else ConcurrentDraftExtension.migrator.migrate end end desc "Copies public assets of the Concurrent Draft to the instance public/ directory." task :update => :environment do is_svn_or_dir = proc {|path| path =~ /\.svn/ || File.directory?(path) } Dir[ConcurrentDraftExtension.root + "/public/**/*"].reject(&is_svn_or_dir).each do |file| path = file.sub(ConcurrentDraftExtension.root, '') directory = File.dirname(path) puts "Copying #{path}..." mkdir_p RAILS_ROOT + directory cp file, RAILS_ROOT + path end end desc "Create drafts for all snippets" task :create_draft_snippets => :environment do print 'copying content to draft_content for all snippets...' Snippet.update_all('draft_content = content') puts 'done.' end desc "Promote all drafts of all assets" task :promote_all => :environment do [Page, Snippet, Layout].each do |asset| print "Promoting all #{asset.to_s.pluralize}..." @user = User.find(:first) ## Admin user asset.find(:all).each(&:promote_draft!) asset.update_all("updated_by_id = #{@user.id}") puts "done." end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems