unidom-action 1.17.6 → 1.17.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d016de7719a0de88c608320a6c0ce2ba5398340
4
- data.tar.gz: fab59826fe2ec5e3e3df236f081e872ade649110
3
+ metadata.gz: 75bcb3792ea47a2cc2d82a913067499296ac7e51
4
+ data.tar.gz: 270fd5519f607b163141640292b60e060795aa91
5
5
  SHA512:
6
- metadata.gz: 9c9d8c1db55ed31de21dd0f976b9b320be1d371608d8e9ec96dae2816396e7d9a77300eec5c9724f0644536852198c4563d20d6430d1b1db8dbe0224e4b3a6e0
7
- data.tar.gz: 37043383d0ff3ff4016b158e7037b85d7a153c4017240d2c87fde601beaed5217d1be615c72a0881672a4c4b86b1ff1d460f2e06b9c5176b6e9e2409a25c3eb8
6
+ metadata.gz: 4bcadc922fd84aebf0eca25237372addb505701018d1c2086d91b339f8f92d580cdb9e593b5afcfc99c3c8e8fb8d710bb21a10ee9db01e6b9ab7f17feadfed49
7
+ data.tar.gz: 5caeedbe12357df9701117f614469e83821a7124e0ab64b13ab1bc1c7ba9fd9df2effe580eab3d24f68487842958fc62047e5d489c807289e2ba29c1bde3d466
@@ -8,8 +8,8 @@ class Unidom::Action::Searching < Unidom::Action::ApplicationRecord
8
8
 
9
9
  include Unidom::Common::Concerns::ModelExtension
10
10
 
11
- validates :resource_name, presence: true, length: { maximum: self.columns_hash['resource_name'].limit }
12
- validates :platform_name, presence: true, length: { maximum: self.columns_hash['platform_name'].limit }
11
+ validates :resource_name, presence: true, length: { in: 1..self.columns_hash['resource_name'].limit }
12
+ validates :platform_name, presence: true, length: { in: 1..self.columns_hash['platform_name'].limit }
13
13
  validates :platform_version, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 0, less_than_or_equal_to: 1_000_000_000 }
14
14
 
15
15
  validates :found_count, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 0, less_than_or_equal_to: 1_000_000_000 }
@@ -13,8 +13,6 @@ describe Unidom::Action::Reason, type: :model do
13
13
  activity_code: 'ZZZZ'
14
14
  }
15
15
 
16
- name_max_length = described_class.columns_hash['name'].limit
17
-
18
16
  it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
19
17
 
20
18
  it_behaves_like 'validates text', model_attributes, :name,
@@ -25,48 +25,17 @@ describe Unidom::Action::Searching, type: :model do
25
25
  current_page: 2
26
26
  }
27
27
 
28
- resource_name_max_length = described_class.columns_hash['resource_name'].limit
29
- platform_name_max_length = described_class.columns_hash['platform_name'].limit
30
-
31
28
  it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
32
29
 
33
30
  it_behaves_like 'belongs_to', model_attributes, :reason, Unidom::Action::Reason, { name: 'Some Reason' }
34
31
 
35
32
  it_behaves_like 'monomorphic scope', model_attributes, :caused_by, :reason
36
33
 
37
- it_behaves_like 'validates', model_attributes, :resource_name,
38
- { } => 0,
39
- { resource_name: nil } => 1,
40
- { resource_name: '' } => 1,
41
- { resource_name: '1' } => 0,
42
- { resource_name: 'A' } => 0,
43
- { resource_name: '11' } => 0,
44
- { resource_name: 'AA' } => 0,
45
- { resource_name: '111' } => 0,
46
- { resource_name: 'AAA' } => 0,
47
- { resource_name: '1'*(resource_name_max_length-1) } => 0,
48
- { resource_name: 'A'*(resource_name_max_length-1) } => 0,
49
- { resource_name: '1'*resource_name_max_length } => 0,
50
- { resource_name: 'A'*resource_name_max_length } => 0,
51
- { resource_name: '1'*(resource_name_max_length+1) } => 1,
52
- { resource_name: 'A'*(resource_name_max_length+1) } => 1
53
-
54
- it_behaves_like 'validates', model_attributes, :platform_name,
55
- { } => 0,
56
- { platform_name: nil } => 1,
57
- { platform_name: '' } => 1,
58
- { platform_name: '1' } => 0,
59
- { platform_name: 'A' } => 0,
60
- { platform_name: '11' } => 0,
61
- { platform_name: 'AA' } => 0,
62
- { platform_name: '111' } => 0,
63
- { platform_name: 'AAA' } => 0,
64
- { platform_name: '1'*(platform_name_max_length-1) } => 0,
65
- { platform_name: 'A'*(platform_name_max_length-1) } => 0,
66
- { platform_name: '1'*platform_name_max_length } => 0,
67
- { platform_name: 'A'*platform_name_max_length } => 0,
68
- { platform_name: '1'*(platform_name_max_length+1) } => 1,
69
- { platform_name: 'A'*(platform_name_max_length+1) } => 1
34
+ it_behaves_like 'validates text', model_attributes, :resource_name,
35
+ length: 1..described_class.columns_hash['resource_name'].limit
36
+
37
+ it_behaves_like 'validates text', model_attributes, :platform_name,
38
+ length: 1..described_class.columns_hash['platform_name'].limit
70
39
 
71
40
  it_behaves_like 'validates numericality', model_attributes, :platform_version,
72
41
  range: 0..1_000_000_000, minimum_inclusive: true, maximum_inclusive: true, only_integer: true
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Action
3
- VERSION = '1.17.6'.freeze
3
+ VERSION = '1.17.7'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-action
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.6
4
+ version: 1.17.7
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-14 00:00:00.000000000 Z
11
+ date: 2017-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common