unidom-price 1.7.3 → 1.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/unidom/price/price.rb +1 -1
- data/lib/rspec/models/unidom/price/price_spec.rb +2 -21
- data/lib/unidom/price/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: af6155b7fa6b0db7e89984b77185841d4c17cb10
|
4
|
+
data.tar.gz: 65fa87de86bff3302a12c3053af1c7300e21b166
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f536bfcad78f27a142255a382b131a5fbf6e0546086cd9db70a28c89c07027dc63bbb9bb3321086937a83aa17a150eff95310e7922054e880e3ec80dd0c2b3e
|
7
|
+
data.tar.gz: 8f2d5fca12f00cba093737f6da900ee59d19872133162f3af77d228d983787927e4b328864a8535a41dbcbf62762d397c00e02b7d81a643e47c42ca197a03af2
|
@@ -9,7 +9,7 @@ class Unidom::Price::Price < Unidom::Price::ApplicationRecord
|
|
9
9
|
include Unidom::Common::Concerns::ModelExtension
|
10
10
|
include ProgneTapera::EnumCode
|
11
11
|
|
12
|
-
validates :amount, presence: true, numericality: {
|
12
|
+
validates :amount, presence: true, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 1_000_000_000 }
|
13
13
|
|
14
14
|
belongs_to :priced, polymorphic: true
|
15
15
|
belongs_to :pricer, polymorphic: true
|
@@ -22,27 +22,8 @@ describe Unidom::Price::Price, type: :model do
|
|
22
22
|
|
23
23
|
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
24
24
|
|
25
|
-
it_behaves_like 'validates', model_attributes, :amount,
|
26
|
-
|
27
|
-
{ amount: nil } => 2,
|
28
|
-
{ amount: '' } => 2,
|
29
|
-
{ amount: '1' } => 0,
|
30
|
-
{ amount: 1 } => 0,
|
31
|
-
{ amount: 'A' } => 1,
|
32
|
-
{ amount: '1.23' } => 0,
|
33
|
-
{ amount: 1.23 } => 0,
|
34
|
-
{ amount: '-0.01' } => 1,
|
35
|
-
{ amount: -0.01 } => 1,
|
36
|
-
{ amount: '0' } => 1,
|
37
|
-
{ amount: 0 } => 1,
|
38
|
-
{ amount: '0.01' } => 0,
|
39
|
-
{ amount: 0.01 } => 0,
|
40
|
-
{ amount: '999_999_999.99' } => 0,
|
41
|
-
{ amount: 999_999_999.99 } => 0,
|
42
|
-
{ amount: '1_000_000_000' } => 1,
|
43
|
-
{ amount: 1_000_000_000 } => 1,
|
44
|
-
{ amount: '1_000_000_000.01' } => 1,
|
45
|
-
{ amount: 1_000_000_000.01 } => 1
|
25
|
+
it_behaves_like 'validates numericality', model_attributes, :amount,
|
26
|
+
range: 0..1_000_000_000, minimum_inclusive: true, maximum_inclusive: true
|
46
27
|
|
47
28
|
it_behaves_like 'ProgneTapera::EnumCode', described_class.new(model_attributes), :calculation, Unidom::Price::Calculation
|
48
29
|
it_behaves_like 'ProgneTapera::EnumCode', described_class.new(model_attributes), :charging, Unidom::Price::Charging
|
data/lib/unidom/price/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-price
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.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: 2017-03-
|
11
|
+
date: 2017-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|