unidom-geo-china 0.5.1 → 0.5.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df8ffc44c1b04d7976b724d7cbbdca3edb47c5d8
|
4
|
+
data.tar.gz: d230a71f6933e49cbfc0664e46daf2c55b4d51b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2e45104d86fc3367d88c06541fdf46388ab521a2d810d776981bfbf9e9f1803c17a712a4a3f06314f8f948427bdac15eafc0db2c16a88287665067180b782ba
|
7
|
+
data.tar.gz: 973e88869c9d7f8d5233d9b2efe6d91da80718489e9b083a0a3e7087ba48a523b555cb938629777b201b2123933ea4b9743490522ca777d4508448027ab55615
|
@@ -33,7 +33,7 @@ class Unidom::Geo::China::Region < Unidom::Geo::China::ApplicationRecord
|
|
33
33
|
|
34
34
|
validates :numeric_code, presence: true, numericality: { integer_only: true, greater_than_or_equal_to: 0 }, length: { minimum: columns_hash['numeric_code'].limit }
|
35
35
|
validates :alphabetic_code, allow_blank: true, length: { minimum: 2 }
|
36
|
-
validates :name, presence: true, length: { in:
|
36
|
+
validates :name, presence: true, length: { in: 1..self.columns_hash['name'].limit }
|
37
37
|
|
38
38
|
belongs_to :scheme, polymorphic: true
|
39
39
|
|
@@ -56,8 +56,8 @@ describe Unidom::Geo::China::Region, type: :model do
|
|
56
56
|
{ } => 0,
|
57
57
|
{ name: nil } => 2,
|
58
58
|
{ name: '' } => 2,
|
59
|
-
{ name: '1' } =>
|
60
|
-
{ name: 'A' } =>
|
59
|
+
{ name: '1' } => 0,
|
60
|
+
{ name: 'A' } => 0,
|
61
61
|
{ name: '11' } => 0,
|
62
62
|
{ name: 'AA' } => 0,
|
63
63
|
{ name: '111' } => 0,
|
data/lib/tasks/data_tasks.rake
CHANGED
@@ -23,7 +23,7 @@ namespace :unidom do
|
|
23
23
|
updated_count = 0
|
24
24
|
created_count = 0
|
25
25
|
|
26
|
-
region_entities = ::Unidom::Geo::China::Region.scheme_id_is(scheme_id).scheme_type_is(scheme_type).
|
26
|
+
region_entities = ::Unidom::Geo::China::Region.scheme_id_is(scheme_id).scheme_type_is(scheme_type).to_a
|
27
27
|
|
28
28
|
each_csv_row file_name do |region|
|
29
29
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-geo-china
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
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-02-
|
11
|
+
date: 2017-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-geo
|