unidom-shopping 1.3 → 1.4

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: 90d8aed7e7fccb99fb0e019369481aaa9ef9cb34
4
- data.tar.gz: ccc5c72a893f298aa7008a10ac66c7f6575d2485
3
+ metadata.gz: 1f7597dd1cff04ef9d75f791bda37bf0d1f14ca4
4
+ data.tar.gz: cf390a74526ae4c4d4dcbb82719c5c14247c5f4e
5
5
  SHA512:
6
- metadata.gz: 1960b8024baff5c6f00a652f80a6316661b558ac6a2084e291692d0d68b8afa78f1e4f11bf30be96afb6f17f842491c4251257a9e9d0077825290b9b0a7de6ee
7
- data.tar.gz: ba2f84b76ce58aedd09ab3fd96bbed334343d7ed0f4a69e16405411a7b05441311852ed5699df8328624385d27e47f0f59afd87fe92dda8de8815fe46a31c392
6
+ metadata.gz: e885c0f7475bb243e5ba945c8762ac9d070591fb535ca36577facd5035c1a8f902bc3d69c075ef223979a4c093aed13f17fa14ccecf1e9c89b0427c4f731e3b8
7
+ data.tar.gz: 2460cd85756481f9afef5b8b9ca048cc5b2f6dfdaf8a560dc50e1cce48e9c18add1919e959449236d9d6c727887ac96555293af35d84519cd90356e15abc19e6
data/README.md CHANGED
@@ -48,6 +48,8 @@ shopping_cart.items.valid_at.alive # fish & ball
48
48
  ```ruby
49
49
  include Unidom::Shopping::Concerns::AsCartShopper
50
50
  include Unidom::Shopping::Concerns::AsItemShopper
51
+ include Unidom::Shopping::Concerns::AsShop
52
+ include Unidom::Shopping::Concerns::AsShopped
51
53
  ```
52
54
 
53
55
  ### As Cart Shopper
@@ -61,3 +63,11 @@ The As Item Shopper concern do the following tasks for the includer automaticall
61
63
  1. Define the has_many :shopping_items macro as: ``has_many :shopping_items, class_name: 'Unidom::Shopping::ShoppingItem', as: :shopper``
62
64
  2. Define the #add! method as: ``add!(it, into: nil, at: Time.now, unit_price: 0, quantity: 1)``
63
65
  3. Define the #add? method as: ``add?(it, into: nil, at: Time.now)``
66
+
67
+ ### As Shop
68
+ The As Shop concern do the following tasks for the includer automatically:
69
+ 1. Define the has_many :shopping_carts macro as: ``has_many :shopping_carts, class_name: 'Unidom::Shopping::ShoppingCart', as: :shop``
70
+
71
+ ### As Shopped
72
+ The As Shopped concern do the following tasks for the includer automatically:
73
+ 1. Define the has_many :shopping_items macro as: ``has_many :shopping_items, class_name: 'Unidom::Shopping::ShoppingItem', as: :shopped``
@@ -0,0 +1,14 @@
1
+ module Unidom::Shopping::Concerns::AsShop
2
+
3
+ extend ActiveSupport::Concern
4
+
5
+ included do |includer|
6
+
7
+ has_many :shopping_carts, class_name: 'Unidom::Shopping::ShoppingCart', as: :shop
8
+
9
+ end
10
+
11
+ module ClassMethods
12
+ end
13
+
14
+ end
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Shopping
3
- VERSION = '1.3'.freeze
3
+ VERSION = '1.4'.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.3'
4
+ version: '1.4'
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-09-26 00:00:00.000000000 Z
11
+ date: 2016-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common
@@ -42,6 +42,7 @@ files:
42
42
  - app/helpers/unidom/shopping/application_helper.rb
43
43
  - app/models/unidom/shopping/concerns/as_cart_shopper.rb
44
44
  - app/models/unidom/shopping/concerns/as_item_shopper.rb
45
+ - app/models/unidom/shopping/concerns/as_shop.rb
45
46
  - app/models/unidom/shopping/concerns/as_shopped.rb
46
47
  - app/models/unidom/shopping/shopping_cart.rb
47
48
  - app/models/unidom/shopping/shopping_item.rb