Rails does not find method send_data
clone_database.rb
require 'zip'
class CloneDatabase < ApplicationController
def self.make_clone
zip_data = 'a'.to_json
send_data zip_data, type: 'application/zip', filename: 'Topic.zip'
end
end
test.rake
namespace :my_namespace do
desc 'Clone database'
task clone_database: :environment do
CloneDatabase.make_clone
end
end