Permalink
Browse files

initial commit

  • Loading branch information...
1 parent 0f3ef31 commit 49b316920a581ed066b82329326d811f11acd46f marcoribi committed Sep 29, 2009
View
BIN .DS_Store
Binary file not shown.
View
@@ -0,0 +1 @@
+nbproject
@@ -0,0 +1,16 @@
+class QueueGenerator < Rails::Generator::Base
+
+ def manifest
+ record do |m|
+ m.file "models/order_queue.rb", "app/models/order_queue.rb"
+ m.migration_template "migrate/create_order_queue.rb", "db/migrate", :migration_file_name => custom_file_name
+ m.readme "USAGE"
+ end
+ end
+
+
+ private
+ def custom_file_name
+ "create_order_queue"
+ end
+end
No changes.
@@ -0,0 +1,12 @@
+class CreateOrderQueue < ActiveRecord::Migration
+ def self.up
+ create_table "order_queues", :force => true do |t|
+ t.column :order, :text
+ end
+ end
+
+ def self.down
+ drop_table "order_queues"
+ end
+end
+
@@ -0,0 +1,7 @@
+module BillboardApi
+ class OrderQueue < ActiveRecord::Base
+ serialize :order
+
+ attr_accessible :order
+ end
+end
View
@@ -1 +1 @@
-require 'inplace'
+require 'billboard_api_queue'
View
@@ -1 +1 @@
-# Install hook code here
+# Install hook code here
@@ -0,0 +1 @@
+#require 'billboard_api_queue/queue'
@@ -0,0 +1,15 @@
+namespace :billboard do
+ desc "Process local Order-Queue"
+ task :process_queue => [:environment] do
+ puts "Start process queue entries"
+
+ OrderQueue.all.each do |entry|
+ order = entry.order
+ if order.save
+ entry.delete
+ end
+ end
+
+ puts "Queue entries were processed"
+ end
+end

0 comments on commit 49b3169

Please sign in to comment.