unidom-shopping 1.5 → 1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/app/models/unidom/shopping/concerns/as_shopped.rb +6 -6
- data/lib/unidom/shopping/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4d78b23b7fdc82ba6599d5c9925cab338f8afb3
|
4
|
+
data.tar.gz: 266676665bc16c4359b174659b3a3865344cfbbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93507261bd565d7a0ca370f389300aa21f5e82f64e2911949e5dcc21ca2958e76577728d4e8b478ee4781ac4d51ee0ccf4fe461844058c848a315ea0ba8f9593
|
7
|
+
data.tar.gz: 5d4f122721186c7eba935f1d25d36b20398ee0b830f68a783f16a25c6b6c218cb3df0a8bb99ebb3e4884a8bc4363edff60e87d53a13b7449c95c6757d52a33d4
|
data/README.md
CHANGED
@@ -90,4 +90,5 @@ The As Shop concern do the following tasks for the includer automatically:
|
|
90
90
|
|
91
91
|
The As Shopped concern do the following tasks for the includer automatically:
|
92
92
|
1. Define the has_many :shopping_items macro as: ``has_many :shopping_items, class_name: 'Unidom::Shopping::ShoppingItem', as: :shopped``
|
93
|
-
2. Define the #is_added! method as: ``is_added!(into: nil, by: nil, at: Time.now, unit_price: 0, quantity: 1)``
|
93
|
+
2. Define the #is_added! method as: ``is_added!(into: nil, by: nil, at: Time.now, unit_price: 0, quantity: 1)``
|
94
|
+
3. Define the #is_added? method as: ``is_added?(into: nil, by: nil, at: Time.now)``
|
@@ -19,12 +19,12 @@ module Unidom::Shopping::Concerns::AsShopped
|
|
19
19
|
item
|
20
20
|
end
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
def is_added?(into: nil, by: nil, at: Time.now)
|
23
|
+
query = shopping_items.shopping_cart_is(into)
|
24
|
+
query = query.shopped_by(by) if by.present?
|
25
|
+
query = query.valid_at(now: at).alive
|
26
|
+
query.exists?
|
27
|
+
end
|
28
28
|
|
29
29
|
end
|
30
30
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-shopping
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.6'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Topbit Du
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|