Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joaquim-oliveira-neto/435c6a6b28f20e80acd0b7cff312e699 to your computer and use it in GitHub Desktop.
Save joaquim-oliveira-neto/435c6a6b28f20e80acd0b7cff312e699 to your computer and use it in GitHub Desktop.
Problem with running rake on production [Solution]
#-----lib/tasks/import.rake------#
require File.expand_path(File.dirname(__FILE__) + '../../../config/environment.rb')
namespace :import do
desc "Given the path of a excel spreadsheet exported from Smart it will import paid invoices "
task :paid_invoices, [:path] => :environment do |t, args|
path = args.path
LegacyImportation.new.paid_invoices_importation(path)
end
desc "Given the path of a excel spreadsheet exported from Smart it will import opened invoices "
task :opened_invoices, [:path] => :environment do |t, args|
path = args.path
LegacyImportation.new.opened_invoices_importation(path)
end
desc "Given the path of a excel spreadsheet exported from Smart it will import payers "
task :payers, [:path] => :environment do |t, args|
path = args.path
LegacyImportation.new.payers_importation(path)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment