[ap4r-devel] [274] branches/200709_gihyo/async_shop: Fixed: small bugs and etc.

kato-k at rubyforge.org kato-k at rubyforge.org
Tue Aug 28 21:50:14 EDT 2007


Revision: 274
Author:   kato-k
Date:     2007-08-28 21:50:13 -0400 (Tue, 28 Aug 2007)

Log Message:
-----------
Fixed: small bugs and etc.

Modified Paths:
--------------
    branches/200709_gihyo/async_shop/as_ap4r/config/queues_mysql.cfg
    branches/200709_gihyo/async_shop/as_rails/app/controllers/async_shop_controller.rb
    branches/200709_gihyo/async_shop/as_rails/db/migrate/001_create_orders.rb
    branches/200709_gihyo/async_shop/as_rails/test/fixtures/orders.yml

Modified: branches/200709_gihyo/async_shop/as_ap4r/config/queues_mysql.cfg
===================================================================
--- branches/200709_gihyo/async_shop/as_ap4r/config/queues_mysql.cfg	2007-08-29 01:45:41 UTC (rev 273)
+++ branches/200709_gihyo/async_shop/as_ap4r/config/queues_mysql.cfg	2007-08-29 01:50:13 UTC (rev 274)
@@ -8,14 +8,10 @@
 drb: 
   host: 
   port: 6438
-  acl: allow 127.0.0.1 allow 10.0.0.0/8 allow ::1
+  acl: allow 127.0.0.1 allow ::1
 dispatchers:
   -
     targets: queue.*
     threads: 3
     modify_rules:
-      url: "Proc.new {|url| url.port = 4001 + rand(3)}"  
-#carriers:
-#  - 
-#    source_uri: druby://another.host.local:6438
-#    threads: 1
+      url: "proc {|url| url.port = 4001 + rand(3)}"

Modified: branches/200709_gihyo/async_shop/as_rails/app/controllers/async_shop_controller.rb
===================================================================
--- branches/200709_gihyo/async_shop/as_rails/app/controllers/async_shop_controller.rb	2007-08-29 01:45:41 UTC (rev 273)
+++ branches/200709_gihyo/async_shop/as_rails/app/controllers/async_shop_controller.rb	2007-08-29 01:50:13 UTC (rev 274)
@@ -12,7 +12,7 @@
     begin
       Order.transaction do
         @order = Order.new(params[:order])
-        @order.save
+        @order.save!
 
         ap4r.async_to({:action => 'payment'},
                       {:order_id => @order.id})
@@ -36,7 +36,7 @@
 
     payment = Payment.new
     payment.order_id = params[:order_id]
-    payment.save
+    payment.save!
     render :text => "true"
   end
 

Modified: branches/200709_gihyo/async_shop/as_rails/db/migrate/001_create_orders.rb
===================================================================
--- branches/200709_gihyo/async_shop/as_rails/db/migrate/001_create_orders.rb	2007-08-29 01:45:41 UTC (rev 273)
+++ branches/200709_gihyo/async_shop/as_rails/db/migrate/001_create_orders.rb	2007-08-29 01:50:13 UTC (rev 274)
@@ -1,7 +1,6 @@
 class CreateOrders < ActiveRecord::Migration
   def self.up
     create_table :orders do |t|
-      t.column :customer_id, :integer
       t.column :item, :string
       t.column :created_at, :datetime
     end

Modified: branches/200709_gihyo/async_shop/as_rails/test/fixtures/orders.yml
===================================================================
--- branches/200709_gihyo/async_shop/as_rails/test/fixtures/orders.yml	2007-08-29 01:45:41 UTC (rev 273)
+++ branches/200709_gihyo/async_shop/as_rails/test/fixtures/orders.yml	2007-08-29 01:50:13 UTC (rev 274)
@@ -1,11 +1,9 @@
 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
 one:
   id: 1
-  customer_id: 1
   item: MyString
   created_at: 2007-08-23
 two:
   id: 2
-  customer_id: 1
   item: MyString
   created_at: 2007-08-23




More information about the ap4r-devel mailing list