[ap4r-devel] [275] tags: Fixed: small bugs and etc.
kato-k at rubyforge.org
kato-k at rubyforge.org
Tue Aug 28 21:51:00 EDT 2007
Revision: 275
Author: kato-k
Date: 2007-08-28 21:50:59 -0400 (Tue, 28 Aug 2007)
Log Message:
-----------
Fixed: small bugs and etc.
Modified Paths:
--------------
tags/200709_gihyo_async_shop/as_ap4r/config/queues_mysql.cfg
tags/200709_gihyo_async_shop/as_rails/app/controllers/async_shop_controller.rb
tags/200709_gihyo_async_shop/as_rails/db/migrate/001_create_orders.rb
tags/200709_gihyo_async_shop/as_rails/test/fixtures/orders.yml
tags/200709_gihyo_async_shop_with_url_rewrite/as_ap4r/config/queues_mysql.cfg
tags/200709_gihyo_async_shop_with_url_rewrite/as_rails/app/controllers/async_shop_controller.rb
tags/200709_gihyo_async_shop_with_url_rewrite/as_rails/db/migrate/001_create_orders.rb
tags/200709_gihyo_async_shop_with_url_rewrite/as_rails/test/fixtures/orders.yml
tags/200709_gihyo_sync_shop/as_rails/app/controllers/async_shop_controller.rb
tags/200709_gihyo_sync_shop/as_rails/db/migrate/001_create_orders.rb
tags/200709_gihyo_sync_shop/as_rails/test/fixtures/orders.yml
Modified: tags/200709_gihyo_async_shop/as_ap4r/config/queues_mysql.cfg
===================================================================
--- tags/200709_gihyo_async_shop/as_ap4r/config/queues_mysql.cfg 2007-08-29 01:50:13 UTC (rev 274)
+++ tags/200709_gihyo_async_shop/as_ap4r/config/queues_mysql.cfg 2007-08-29 01:50:59 UTC (rev 275)
@@ -8,12 +8,8 @@
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: 1
-#carriers:
-# -
-# source_uri: druby://another.host.local:6438
-# threads: 1
Modified: tags/200709_gihyo_async_shop/as_rails/app/controllers/async_shop_controller.rb
===================================================================
--- tags/200709_gihyo_async_shop/as_rails/app/controllers/async_shop_controller.rb 2007-08-29 01:50:13 UTC (rev 274)
+++ tags/200709_gihyo_async_shop/as_rails/app/controllers/async_shop_controller.rb 2007-08-29 01:50:59 UTC (rev 275)
@@ -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: tags/200709_gihyo_async_shop/as_rails/db/migrate/001_create_orders.rb
===================================================================
--- tags/200709_gihyo_async_shop/as_rails/db/migrate/001_create_orders.rb 2007-08-29 01:50:13 UTC (rev 274)
+++ tags/200709_gihyo_async_shop/as_rails/db/migrate/001_create_orders.rb 2007-08-29 01:50:59 UTC (rev 275)
@@ -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: tags/200709_gihyo_async_shop/as_rails/test/fixtures/orders.yml
===================================================================
--- tags/200709_gihyo_async_shop/as_rails/test/fixtures/orders.yml 2007-08-29 01:50:13 UTC (rev 274)
+++ tags/200709_gihyo_async_shop/as_rails/test/fixtures/orders.yml 2007-08-29 01:50:59 UTC (rev 275)
@@ -1,11 +1,9 @@
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
one:
id: 1
- customer_id: 1
item: MyString
orderd_at: 2007-08-23
two:
id: 2
- customer_id: 1
item: MyString
orderd_at: 2007-08-23
Modified: tags/200709_gihyo_async_shop_with_url_rewrite/as_ap4r/config/queues_mysql.cfg
===================================================================
--- tags/200709_gihyo_async_shop_with_url_rewrite/as_ap4r/config/queues_mysql.cfg 2007-08-29 01:50:13 UTC (rev 274)
+++ tags/200709_gihyo_async_shop_with_url_rewrite/as_ap4r/config/queues_mysql.cfg 2007-08-29 01:50:59 UTC (rev 275)
@@ -8,14 +8,11 @@
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: tags/200709_gihyo_async_shop_with_url_rewrite/as_rails/app/controllers/async_shop_controller.rb
===================================================================
--- tags/200709_gihyo_async_shop_with_url_rewrite/as_rails/app/controllers/async_shop_controller.rb 2007-08-29 01:50:13 UTC (rev 274)
+++ tags/200709_gihyo_async_shop_with_url_rewrite/as_rails/app/controllers/async_shop_controller.rb 2007-08-29 01:50:59 UTC (rev 275)
@@ -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: tags/200709_gihyo_async_shop_with_url_rewrite/as_rails/db/migrate/001_create_orders.rb
===================================================================
--- tags/200709_gihyo_async_shop_with_url_rewrite/as_rails/db/migrate/001_create_orders.rb 2007-08-29 01:50:13 UTC (rev 274)
+++ tags/200709_gihyo_async_shop_with_url_rewrite/as_rails/db/migrate/001_create_orders.rb 2007-08-29 01:50:59 UTC (rev 275)
@@ -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: tags/200709_gihyo_async_shop_with_url_rewrite/as_rails/test/fixtures/orders.yml
===================================================================
--- tags/200709_gihyo_async_shop_with_url_rewrite/as_rails/test/fixtures/orders.yml 2007-08-29 01:50:13 UTC (rev 274)
+++ tags/200709_gihyo_async_shop_with_url_rewrite/as_rails/test/fixtures/orders.yml 2007-08-29 01:50:59 UTC (rev 275)
@@ -1,11 +1,9 @@
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
one:
id: 1
- customer_id: 1
item: MyString
orderd_at: 2007-08-23
two:
id: 2
- customer_id: 1
item: MyString
orderd_at: 2007-08-23
Modified: tags/200709_gihyo_sync_shop/as_rails/app/controllers/async_shop_controller.rb
===================================================================
--- tags/200709_gihyo_sync_shop/as_rails/app/controllers/async_shop_controller.rb 2007-08-29 01:50:13 UTC (rev 274)
+++ tags/200709_gihyo_sync_shop/as_rails/app/controllers/async_shop_controller.rb 2007-08-29 01:50:59 UTC (rev 275)
@@ -12,7 +12,7 @@
begin
Order.transaction do
@order = Order.new(params[:order])
- @order.save
+ @order.save!
payment(@order[:id])
flash[:notice] = 'Order was successfully created.'
@@ -35,7 +35,7 @@
payment = Payment.new
payment.order_id = order_id
- payment.save
+ payment.save!
end
end
Modified: tags/200709_gihyo_sync_shop/as_rails/db/migrate/001_create_orders.rb
===================================================================
--- tags/200709_gihyo_sync_shop/as_rails/db/migrate/001_create_orders.rb 2007-08-29 01:50:13 UTC (rev 274)
+++ tags/200709_gihyo_sync_shop/as_rails/db/migrate/001_create_orders.rb 2007-08-29 01:50:59 UTC (rev 275)
@@ -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: tags/200709_gihyo_sync_shop/as_rails/test/fixtures/orders.yml
===================================================================
--- tags/200709_gihyo_sync_shop/as_rails/test/fixtures/orders.yml 2007-08-29 01:50:13 UTC (rev 274)
+++ tags/200709_gihyo_sync_shop/as_rails/test/fixtures/orders.yml 2007-08-29 01:50:59 UTC (rev 275)
@@ -1,11 +1,9 @@
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
one:
id: 1
- customer_id: 1
item: MyString
orderd_at: 2007-08-23
two:
id: 2
- customer_id: 1
item: MyString
orderd_at: 2007-08-23
More information about the ap4r-devel
mailing list