Sha256: f4b4596cef1d4a36c7f145b595fa7134f21c41c5ba871c2e09a798a338eac4b0
Contents?: true
Size: 591 Bytes
Versions: 3
Compression:
Stored size: 591 Bytes
Contents
namespace :simple_cart do desc "Adding new delivery service to 'deliveries' table. Syntax: 'rake simple_cart:create_delivery [NAME] [COSTS]'" task :create_delivery => :environment do ARGV.each { |a| task a.to_sym do ; end } SimpleCart::Delivery.create(company: ARGV[1], costs: ARGV[2]) puts "#{ARGV[1]} was successfully added." end task :delete_delivery => :environment do ARGV.each { |a| task a.to_sym do ; end } SimpleCart::Delivery.find_by(company: ARGV[1]).destroy end task :delete_all => :environment do SimpleCart::Delivery.delete_all end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
simple_cart-0.0.5 | lib/tasks/simple_cart_tasks.rake |
simple_cart-0.0.4 | lib/tasks/simple_cart_tasks.rake |
simple_cart-0.0.3 | lib/tasks/simple_cart_tasks.rake |