shop_bunny 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
data/app/models/cart_item.rb
CHANGED
data/app/models/coupon.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
module ShopBunny
|
2
2
|
module CartModule
|
3
3
|
|
4
|
-
|
5
4
|
def self.included(clazz)
|
6
5
|
clazz.send(:attr_accessor, :coupon_code)
|
7
6
|
clazz.send(:has_many, :cart_items, :dependent => :destroy)
|
@@ -13,9 +12,6 @@ module ShopBunny
|
|
13
12
|
clazz.send(:validate, :coupon_code_must_be_valid)
|
14
13
|
end
|
15
14
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
15
|
def items
|
20
16
|
self.cart_items
|
21
17
|
end
|
@@ -92,6 +88,11 @@ module ShopBunny
|
|
92
88
|
ShopBunny.item_model_class_name.constantize
|
93
89
|
end
|
94
90
|
|
91
|
+
# Check if the cart is empty
|
92
|
+
def empty?
|
93
|
+
cart_items.empty?
|
94
|
+
end
|
95
|
+
|
95
96
|
# Make
|
96
97
|
def as_json(options={})
|
97
98
|
{
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shop_bunny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 4
|
10
|
+
version: 0.7.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- kopfmaschine.com
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09-
|
18
|
+
date: 2010-09-29 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|