Sha256: a3c69dcaa1fea18b200270ca1f60517e7acce4833b34b261adc7f42e398c5a96
Contents?: true
Size: 422 Bytes
Versions: 30
Compression:
Stored size: 422 Bytes
Contents
# frozen_string_literal: true namespace :codebook do desc "Export all questionnaire codebooks to tmp/codebooks/$key.txt" task :export => :environment do system("mkdir -p #{Rails.root}/tmp/codebooks") Questionnaire.all.each do |questionnaire| File.open("#{Rails.root}/tmp/codebooks/#{questionnaire.key}.txt", "w") do |file| file.puts(questionnaire.to_codebook) end end end end
Version data entries
30 entries across 30 versions & 1 rubygems