unidom-shopping 1.7.8 → 2.0

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
- SHA1:
3
- metadata.gz: 1548647b8b13755ca7d414a601fbe6e94c317b1e
4
- data.tar.gz: 0a163221d51585cfae5ebfb47a62f1b2bb6c6f7e
2
+ SHA256:
3
+ metadata.gz: 19549b0781e7a5a0740dacc5edaaf663856b27ab1e9fa75945af8cd885254a34
4
+ data.tar.gz: 5bb273a96325c1d43f22cea07b07f69fab9a788cbfbb16e22833962a791f4f78
5
5
  SHA512:
6
- metadata.gz: 9ef062e2df7d18a3e388ca5b5a4852ddd673a3ac31f01f98073b6df500cfb6c67f9d9cc7ae24f4d2f0c4f37c71c3f372de3ebf8864811775213bc6573716ef25
7
- data.tar.gz: 2465a6c0a6bae51c6ef4c8aba313e0e5ac3adc9f1d89965123f3cad9c3bf6565a90477aa3031e3751462d3163525cbeefb2419c1f7108fa6c5328bb3e76a82cc
6
+ metadata.gz: d0d760891d68cb4fb09c15f6807a566d393362e0ea8ecbd7fecd648f57dc6c4b0be8df067b9cbd70e68ca5b3aeb86b768f29fe9c994af22040b3528b56c0389b
7
+ data.tar.gz: b3e238a6198eb80537d64156a06a21502e99ad535245c917f11f9cc48f0307b5fbdb10c02409d5ab291c309d510c9c981a4e28fc92c18df264b627694235a91f
@@ -7,8 +7,8 @@ class Unidom::Shopping::ShoppingItem < Unidom::Shopping::ApplicationRecord
7
7
 
8
8
  include Unidom::Common::Concerns::ModelExtension
9
9
 
10
- validates :unit_price, presence: true, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 1_000_000_000 }
11
- validates :quantity, presence: true, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 1_000_000_000 }
10
+ validates :unit_price, presence: true, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: Unidom::Common::MAXIMUM_AMOUNT }
11
+ validates :quantity, presence: true, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: Unidom::Common::MAXIMUM_AMOUNT }
12
12
 
13
13
  belongs_to :shopping_cart, class_name: 'Unidom::Shopping::ShoppingCart'
14
14
  belongs_to :shopper, polymorphic: true
@@ -10,8 +10,8 @@ class CreateUnidomShoppingCarts < ActiveRecord::Migration
10
10
  polymorphic: { null: false, default: '', limit: 200 }
11
11
 
12
12
  t.column :state, 'char(1)', null: false, default: 'C'
13
- t.datetime :opened_at, null: false, default: ::Time.utc(1970)
14
- t.datetime :closed_at, null: false, default: ::Time.utc(3000)
13
+ t.datetime :opened_at, null: false, default: Unidom::Common::OPENED_AT
14
+ t.datetime :closed_at, null: false, default: Unidom::Common::CLOSED_AT
15
15
  t.boolean :defunct, null: false, default: false
16
16
  t.jsonb :notation, null: false, default: {}
17
17
 
@@ -14,8 +14,8 @@ class CreateUnidomShoppingItems < ActiveRecord::Migration
14
14
  t.decimal :quantity, null: false, default: 0.0, precision: 12, scale: 2
15
15
 
16
16
  t.column :state, 'char(1)', null: false, default: 'C'
17
- t.datetime :opened_at, null: false, default: ::Time.utc(1970)
18
- t.datetime :closed_at, null: false, default: ::Time.utc(3000)
17
+ t.datetime :opened_at, null: false, default: Unidom::Common::OPENED_AT
18
+ t.datetime :closed_at, null: false, default: Unidom::Common::CLOSED_AT
19
19
  t.boolean :defunct, null: false, default: false
20
20
  t.jsonb :notation, null: false, default: {}
21
21
 
@@ -21,9 +21,9 @@ describe Unidom::Shopping::ShoppingItem, type: :model do
21
21
  it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
22
22
 
23
23
  it_behaves_like 'validates numericality', model_attributes, :unit_price,
24
- range: 0..1_000_000_000, minimum_inclusive: true, maximum_inclusive: true
24
+ range: 0..Unidom::Common::MAXIMUM_AMOUNT, minimum_inclusive: true, maximum_inclusive: true
25
25
  it_behaves_like 'validates numericality', model_attributes, :quantity,
26
- range: 0..1_000_000_000, minimum_inclusive: true, maximum_inclusive: true
26
+ range: 0..Unidom::Common::MAXIMUM_AMOUNT, minimum_inclusive: true, maximum_inclusive: true
27
27
 
28
28
  shopping_cart_attributes = {
29
29
  shopper_id: SecureRandom.uuid,
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Shopping
3
- VERSION = '1.7.8'.freeze
3
+ VERSION = '2.0'.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.7.8
4
+ version: '2.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-24 00:00:00.000000000 Z
11
+ date: 2020-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.9'
19
+ version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.9'
26
+ version: '2.0'
27
27
  description: Unidom (UNIfied Domain Object Model) is a series of domain model engines.
28
28
  The Shopping domain model engine includes Shopping Cart and Shopping Item models.
29
29
  Unidom (统一领域对象模型)是一系列的领域模型引擎。购物领域模型引擎包括购物车和购物项的模型。
@@ -87,8 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  requirements: []
90
- rubyforge_project:
91
- rubygems_version: 2.6.4
90
+ rubygems_version: 3.1.2
92
91
  signing_key:
93
92
  specification_version: 4
94
93
  summary: Unidom Shopping Domain Model Engine 购物领域模型引擎