egov_utils 1.5.0.alpha8 → 1.5.0.alpha10
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: 5be2f7d146ffd93939d4439e5499f8c6bb3850bb7c71f4e966b5c985497fa99f
|
4
|
+
data.tar.gz: dbe8a432e8db4a475b40507a6b30977c63f6503faa5055c2906fac9f49ef75f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfc3b34cad592a56c854f03a9f5831162718c2fcd817f3d421efec9383b0a918eb764623b9cbac2a54ed54371848cbd9a6e23d7407dd113612eb354a7663d9a6
|
7
|
+
data.tar.gz: f12174cc8e38f84ee8dcf1534e9ef6f4cb5fa913c669bb964dbf7f039b3d8b2d16a617c87600ac7faa6438953ac7c7bf04b7dec0de0aea11fd9516a8d2f4a143
|
@@ -70,6 +70,7 @@ window.eGovUtilities =
|
|
70
70
|
$form = $(this).closest('.person-form');
|
71
71
|
$form.find('.natural_person').toggle( val == 'natural').find(':input').prop('disabled', val != 'natural');
|
72
72
|
$form.find('.legal_person').toggle( val == 'legal').find(':input').prop('disabled', val != 'legal');
|
73
|
+
$form.find("input[name*='[remote_id]']").val('');
|
73
74
|
)
|
74
75
|
$type_toggles.each (index)->
|
75
76
|
$el = $(this)
|
@@ -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.alpha10
|
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-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|