unidom-geo-china 0.4.4 → 0.4.5

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: 71e39cec7a0bce1349841e2cf5e4352c7082c4ec
4
- data.tar.gz: af06ebe87a607b5c1e63c2ffaaf63194b8e6095e
3
+ metadata.gz: 515a081cc7eaf92f46bb64b376ee447336fa78da
4
+ data.tar.gz: bf0ff13ab19e1cca6f4bef009fa0d8d1235f0c33
5
5
  SHA512:
6
- metadata.gz: ea54468feea57932da66caa546f1b8d9b2dc341dfdc4c8362834f3eac374e8326e775be7a48be528f068014be82636e640b7db4c0559d2be75fcbab530e368e6
7
- data.tar.gz: 006a271d875c23dafd551ed3733c9e7a9c28686abafe04c697dd679a24de27964b7ddc8bf86a2f0ffef770e37948ee3055f633f75d0ac97819582d2765b456f1
6
+ metadata.gz: 7125b61fbeb8609ca3bdd494299ed8692544fc916a927572fb3d75cf5c761756236e5d1dd8a51fa4a9d1c05eede715a28839bb5d5f05706addf7e6611375272f
7
+ data.tar.gz: c3ad7e6555a5babb56ac9dedf4610356f66f8d7cdf5f2f89a42133b70ecaab6867047257fc5183842e13d377659320b526dcc8fd9bf131f377e145d49215871d
@@ -1,3 +1,6 @@
1
+ ##
2
+ # As Inferior Region 是下级行政区划的关注点。
3
+
1
4
  module Unidom::Geo::China::Concerns::AsInferiorRegion
2
5
 
3
6
  extend ActiveSupport::Concern
@@ -1,3 +1,6 @@
1
+ ##
2
+ # As Superior Region 是上级行政区划的关注点。
3
+
1
4
  module Unidom::Geo::China::Concerns::AsSuperiorRegion
2
5
 
3
6
  extend ActiveSupport::Concern
@@ -1,11 +1,12 @@
1
+ ##
1
2
  # Region 是中国行政区划。
2
3
  # 《GB/T 2260-2007 中华人民共和国行政区划代码》
3
4
  # 数字码采用三层六位层次码结构,按层次分别表示我国各
4
5
  # 省(自治区,直辖市,特别行政区)、
5
6
  # 市(地区,自治州,盟)、
6
7
  # 县(自治县、县级市、旗、自治旗、市辖区、林区、特区)。
7
- # 第1、2位数字:所在省份编码,表示省、自治区、直辖市、特别行政区。
8
- # 第3、4位数字:所在省级市(县)编码,表示市、地区、自治州、盟、直辖市所辖市辖区、县汇总码、省(自治区)直辖县级行政区划汇总码。
8
+ # 第1、2位数字:所在省份编码,表示省、自治区、直辖市、特别行政区。
9
+ # 第3、4位数字:所在省级市(县)编码,表示市、地区、自治州、盟、直辖市所辖市辖区、县汇总码、省(自治区)直辖县级行政区划汇总码。
9
10
  # 01~20、51~70表示市,直辖市则01表示市区,02以后表示直辖市辖区内的郊县;
10
11
  # 21~50表示地区、自治州、盟;
11
12
  # 90表示省(自治区)直辖县级行政区划汇总码。
@@ -79,23 +80,6 @@ class Unidom::Geo::China::Region < Unidom::Geo::China::ApplicationRecord
79
80
  under_mducg? && numeric_code_middle_empty? && numeric_code_suffix_empty?
80
81
  end
81
82
 
82
- =begin
83
- def super_regions
84
- numeric_code_suffix_empty? ? (numeric_code_middle_empty? ? self.class.none : self.class.numeric_coded_as("#{numeric_code_prefix}0000")) : self.class.numeric_coded_as("#{numeric_code_prefix}#{numeric_code_middle}00")
85
- end
86
-
87
- def sub_regions
88
- if numeric_code_suffix_empty?
89
- prefix = numeric_code_middle_empty? ? numeric_code_prefix : "#{numeric_code_prefix}#{numeric_code_middle}"
90
- regions = self.class.numeric_code_starting_with(prefix).not_numeric_coded_as(numeric_code)
91
- regions = regions.numeric_code_ending_with('00') if numeric_code_middle_empty?
92
- regions
93
- else
94
- self.class.none
95
- end
96
- end
97
- =end
98
-
99
83
  def full_name(separator = ' ')
100
84
  final_name = self.name
101
85
  current_region = self
@@ -1,4 +1,5 @@
1
- # Town 是乡或者镇。
1
+ ##
2
+ # Town 是中国的乡或者镇。
2
3
 
3
4
  class Unidom::Geo::China::Town < Unidom::Geo::China::ApplicationRecord
4
5
 
@@ -4,14 +4,14 @@ module Unidom
4
4
 
5
5
  class Engine < ::Rails::Engine
6
6
 
7
+ include Unidom::Common::EngineExtension
8
+
7
9
  isolate_namespace ::Unidom::Geo::China
8
10
 
9
- initializer :append_migrations do |app|
10
- config.paths['db/migrate'].expanded.each { |expanded_path| app.config.paths['db/migrate'] << expanded_path } unless app.root.to_s.match root.to_s
11
- end
11
+ enable_initializer enum_enabled: false, migration_enabled: true
12
12
 
13
13
  end
14
14
 
15
15
  end
16
16
  end
17
- end
17
+ end
@@ -1,7 +1,7 @@
1
1
  module Unidom
2
2
  module Geo
3
3
  module China
4
- VERSION = '0.4.4'.freeze
4
+ VERSION = '0.4.5'.freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-geo-china
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
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-12-06 00:00:00.000000000 Z
11
+ date: 2017-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-geo
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.4'
17
20
  - - ">="
18
21
  - !ruby/object:Gem::Version
19
- version: 1.4.3
22
+ version: 1.4.4
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '1.4'
24
30
  - - ">="
25
31
  - !ruby/object:Gem::Version
26
- version: 1.4.3
32
+ version: 1.4.4
27
33
  description: Unidom (UNIfied Domain Object Model) is a series of domain model engines.
28
34
  The China Contact domain model engine includes Mobile Phone Number and its relative
29
35
  models. Unidom (统一领域对象模型)是一系列的领域模型引擎。中国地理领域模型引擎包括中国大陆的行政区划及其相关的模型。