shop_bunny 0.7.4.9 → 0.7.4.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/shop_bunny/cart_module.rb +6 -5
- metadata +17 -17
@@ -66,12 +66,13 @@ module ShopBunny
|
|
66
66
|
#removes a quantity of an article specified by :article_id, returns nil if no article has been found
|
67
67
|
def remove_item(item,options = {})
|
68
68
|
cart_item = self.cart_items.find_by_item_id(item)
|
69
|
-
|
70
|
-
options[:quantity] ||= cart_item.quantity
|
71
69
|
if cart_item
|
72
|
-
|
73
|
-
cart_item
|
74
|
-
|
70
|
+
options[:quantity] ||= cart_item.quantity
|
71
|
+
if cart_item
|
72
|
+
cart_item.quantity -= options[:quantity]
|
73
|
+
cart_item.save!
|
74
|
+
self.reload
|
75
|
+
end
|
75
76
|
end
|
76
77
|
cart_item
|
77
78
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shop_bunny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 115
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
9
|
- 4
|
10
|
-
-
|
11
|
-
version: 0.7.4.
|
10
|
+
- 10
|
11
|
+
version: 0.7.4.10
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- kopfmaschine.com
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-11-
|
19
|
+
date: 2010-11-22 00:00:00 +01:00
|
20
20
|
default_executable:
|
21
21
|
dependencies: []
|
22
22
|
|
@@ -30,32 +30,32 @@ extensions: []
|
|
30
30
|
extra_rdoc_files: []
|
31
31
|
|
32
32
|
files:
|
33
|
-
- lib/generators/shop_bunny/install_generator.rb
|
34
|
-
- lib/generators/shop_bunny/templates/shopbunny_controller_template.rb
|
35
33
|
- lib/generators/shop_bunny/templates/shopbunny_model_template.rb
|
34
|
+
- lib/generators/shop_bunny/templates/shopbunny_controller_template.rb
|
35
|
+
- lib/generators/shop_bunny/install_generator.rb
|
36
|
+
- lib/shop_bunny.rb
|
36
37
|
- lib/shop_bunny/cart_controller_module.rb
|
37
38
|
- lib/shop_bunny/cart_module.rb
|
38
|
-
- lib/shop_bunny/engine.rb
|
39
39
|
- lib/shop_bunny/shipping_cost_calculator.rb
|
40
|
-
- lib/shop_bunny.rb
|
41
|
-
- app/
|
42
|
-
- app/controllers/carts_controller.rb
|
40
|
+
- lib/shop_bunny/engine.rb
|
41
|
+
- app/views/carts/show.html.erb
|
43
42
|
- app/models/cart.rb
|
43
|
+
- app/models/coupon_use.rb
|
44
44
|
- app/models/cart_item.rb
|
45
45
|
- app/models/coupon.rb
|
46
|
-
- app/models/coupon_use.rb
|
47
46
|
- app/models/item.rb
|
48
|
-
- app/
|
49
|
-
-
|
50
|
-
- db/migrate/
|
51
|
-
- db/migrate/20100915073016_create_items.rb
|
47
|
+
- app/controllers/application_controller.rb
|
48
|
+
- app/controllers/carts_controller.rb
|
49
|
+
- db/migrate/20100915162029_remove_owner_id_from_carts.rb
|
52
50
|
- db/migrate/20100915091059_create_coupons.rb
|
51
|
+
- db/migrate/20100915073016_create_items.rb
|
52
|
+
- db/migrate/20100902115627_create_carts.rb
|
53
53
|
- db/migrate/20100915093821_create_coupon_uses.rb
|
54
|
-
- db/migrate/20100915162029_remove_owner_id_from_carts.rb
|
55
54
|
- db/migrate/20100916194407_set_default_column_value_for_cart_items_quantity.rb
|
55
|
+
- db/migrate/20100902115757_create_cart_items.rb
|
56
56
|
- config/initializers/add_cart_finder_to_controllers.rb
|
57
|
-
- config/initializers/machinist.rb
|
58
57
|
- config/initializers/shop_bunny.rb
|
58
|
+
- config/initializers/machinist.rb
|
59
59
|
- config/routes.rb
|
60
60
|
has_rdoc: true
|
61
61
|
homepage: http://kopfmaschine.com
|