egov_utils 1.5.0.alpha8 → 1.5.0.alpha9
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdd3ba5d80c2b78ca123456c6c866cb6bbc82d8555559e2d373606b6598c4a9c
|
4
|
+
data.tar.gz: 12288d09e8d4408edf545abb46607bcca029b2ef28ea7d1c4ddbac7649e56ed9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d8792b34656d1e1e3b233041515a4b586d3ae2e4b046d740a92dc933d1c7ff6d4731ee817aea591e9f55a1db0b7a61f981d95858853683a3a7b536777b708ff
|
7
|
+
data.tar.gz: 126be5c5148fd7200c58d72142a5baade0c0c2cfa1f3d333b90a5a298492aff2240a1ae0c47201b74bebd2c18b8e3527ece516f3dfbe93fb698883f7457889ee
|
@@ -11,6 +11,8 @@ module EgovUtils
|
|
11
11
|
enum person_type: { natural: 1, legal: 16 }
|
12
12
|
|
13
13
|
validates :person_entity, presence: true
|
14
|
+
|
15
|
+
before_validation :keep_correct_person_type
|
14
16
|
before_validation :set_person_from_remote_id
|
15
17
|
|
16
18
|
accepts_nested_attributes_for :residence, :natural_person, :legal_person
|
@@ -79,5 +81,14 @@ module EgovUtils
|
|
79
81
|
self.residence =
|
80
82
|
EgovUtils::Iszr::Addresses::Fetch.run!(remote_id:, person_type:)
|
81
83
|
end
|
84
|
+
|
85
|
+
def keep_correct_person_type
|
86
|
+
case person_type
|
87
|
+
when 'natural'
|
88
|
+
self.legal_person = nil
|
89
|
+
when 'legal'
|
90
|
+
self.natural_person = nil
|
91
|
+
end
|
92
|
+
end
|
82
93
|
end
|
83
94
|
end
|
@@ -9,7 +9,8 @@ module EgovUtils
|
|
9
9
|
|
10
10
|
def handle_response!
|
11
11
|
EgovUtils::Address.new(
|
12
|
-
street:
|
12
|
+
street:
|
13
|
+
response_body.xpath('//UliceNazev').text.presence || response_body.xpath('//CastObceNazev').text,
|
13
14
|
house_number: response_body.xpath('//CisloDomovni').text,
|
14
15
|
orientation_number: response_body.xpath('//CisloOrientacni').text,
|
15
16
|
city: response_body.xpath('//ObecNazev').text,
|
data/lib/egov_utils/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: egov_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.0.
|
4
|
+
version: 1.5.0.alpha9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ondřej Ezr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|