shop_bunny 0.7.0.1 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,6 +24,9 @@ class CartsController < ApplicationController
24
24
  format.html { redirect_to :action => :show }
25
25
  end
26
26
  end
27
+
28
+ def checkout
29
+ end
27
30
 
28
31
  def update
29
32
  @cart.update_attributes(params[:cart])
data/app/models/cart.rb CHANGED
@@ -36,7 +36,7 @@ class Cart < ActiveRecord::Base
36
36
  sum -= absolute_discount
37
37
  sum *= relative_discount
38
38
 
39
- sum + shipping_costs
39
+ sum += shipping_costs
40
40
 
41
41
  [0, sum].max
42
42
  end
@@ -80,4 +80,7 @@
80
80
  <%= f.submit :value => "Add code" %>
81
81
  <% end %>
82
82
  </div>
83
- </div>
83
+ <div class="checkout">
84
+ <%= link_to "checkout", :controller => "carts", :action => :checkout %>
85
+ </div>
86
+ </div>
data/config/routes.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  Rails.application.routes.draw do
2
2
  resource :cart, :only => [:show, :update] do
3
+ get :checkout
3
4
  get :add_item, :as => 'add_item_to'
4
5
  get :remove_item, :as => 'remove_item_from'
5
6
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shop_bunny
3
3
  version: !ruby/object:Gem::Version
4
- hash: 117
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 0
10
9
  - 1
11
- version: 0.7.0.1
10
+ version: 0.7.1
12
11
  platform: ruby
13
12
  authors:
14
13
  - kopfmaschine.com
@@ -16,7 +15,7 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2010-09-20 00:00:00 +02:00
18
+ date: 2010-09-21 00:00:00 +02:00
20
19
  default_executable:
21
20
  dependencies: []
22
21
 
@@ -30,28 +29,28 @@ extensions: []
30
29
  extra_rdoc_files: []
31
30
 
32
31
  files:
33
- - lib/generators/shop_bunny/install_generator.rb
34
32
  - lib/shop_bunny.rb
35
- - lib/shop_bunny/shipping_cost_calculator.rb
36
33
  - lib/shop_bunny/engine.rb
34
+ - lib/shop_bunny/shipping_cost_calculator.rb
35
+ - lib/generators/shop_bunny/install_generator.rb
37
36
  - app/views/carts/show.html.erb
38
- - app/models/cart.rb
39
37
  - app/models/coupon_use.rb
40
- - app/models/cart_item.rb
41
38
  - app/models/coupon.rb
39
+ - app/models/cart.rb
42
40
  - app/models/item.rb
41
+ - app/models/cart_item.rb
43
42
  - app/controllers/application_controller.rb
44
43
  - app/controllers/carts_controller.rb
45
- - db/migrate/20100915162029_remove_owner_id_from_carts.rb
44
+ - db/migrate/20100915093821_create_coupon_uses.rb
46
45
  - db/migrate/20100915091059_create_coupons.rb
47
- - db/migrate/20100915073016_create_items.rb
46
+ - db/migrate/20100915162029_remove_owner_id_from_carts.rb
48
47
  - db/migrate/20100902115627_create_carts.rb
49
- - db/migrate/20100915093821_create_coupon_uses.rb
50
48
  - db/migrate/20100916194407_set_default_column_value_for_cart_items_quantity.rb
49
+ - db/migrate/20100915073016_create_items.rb
51
50
  - db/migrate/20100902115757_create_cart_items.rb
52
- - config/initializers/add_cart_finder_to_controllers.rb
53
51
  - config/initializers/shop_bunny.rb
54
52
  - config/initializers/machinist.rb
53
+ - config/initializers/add_cart_finder_to_controllers.rb
55
54
  - config/routes.rb
56
55
  has_rdoc: true
57
56
  homepage: http://kopfmaschine.com