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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42d829fc77ba0db5c34938988b0efd7aee86484c
4
- data.tar.gz: 81fb85b40868d5affa293da912bf803728790d26
3
+ metadata.gz: f4d78b23b7fdc82ba6599d5c9925cab338f8afb3
4
+ data.tar.gz: 266676665bc16c4359b174659b3a3865344cfbbb
5
5
  SHA512:
6
- metadata.gz: 4fa9fb539419f36cff69d2e7760321dbbae92aead279e6fc2dd45731e4c0739153bffcbaa64e55dfb2a3b2278d029168464d0f6364c0140b649493d2bd29142f
7
- data.tar.gz: 58f37b443f11ebc1ad4d482c620b7ed771170081c1a96ff1709d8612d66b7ca479ea185afe26f898c8f9aecb242e9970af985a1b076f7bb11db4749d8f7780c6
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
- #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
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
 
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Shopping
3
- VERSION = '1.5'.freeze
3
+ VERSION = '1.6'.freeze
4
4
  end
5
5
  end
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.5'
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-10 00:00:00.000000000 Z
11
+ date: 2016-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common