egov_utils 1.4.3 → 1.4.5

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
  SHA256:
3
- metadata.gz: f59b9c738bfe2ebd79c6530995f7ce49fd478365245c04725cb9e98f056da46a
4
- data.tar.gz: d04950c0c7be271dde65c647d23ca6b3e3677186c2c7da119270bbb9249eaf13
3
+ metadata.gz: a4a3886729d570a5525494c5c4ac720c4b84a63ace576b0844651061adb14b50
4
+ data.tar.gz: 79f2d1e38ad215c1611dde7519771b3be8780b2900f4db7e7de44d42fb41986a
5
5
  SHA512:
6
- metadata.gz: 54b882c6fdc2fa34eca1b363ef3c557cea0b7d8c0d40d801c0565cdaee3e08278f700f4d01204bb46b7e7ec783a32eb0880f246eec68e9d7f0cb68bb4d718dfa
7
- data.tar.gz: b2c622fba5f4800cab1f77780a07ed211a7da37c3927817ed6cac4d8520267b347d55c751fa83d5c9731d791c9cea8b9c3f9dc807096fa22cb4c8360f2e630f1
6
+ metadata.gz: 22670485189a5a46bde82f39322b71e8d18ae2222f8b369d15f5b0faf180c8139c0e94f8b0c86696b2a6b5318feea87dd58a7c10c854dd34de707da56de7cc7d
7
+ data.tar.gz: 4e286f208dcc5093c6c219483337c82997bf9646f3da4d0f37489aab590878c42e57aa460eeab65f50155e20bc2a77da202a612542601717a3d737b768cb4839
@@ -1,5 +1,8 @@
1
1
  module EgovUtils
2
2
  class LegalPerson < AbstractPerson
3
+ before_validation :strip_spaces_from_ico
4
+
5
+ validates :ico, length: { is: 8 }
3
6
 
4
7
  belongs_to :person, class_name: 'EgovUtils::Person'
5
8
 
@@ -11,5 +14,10 @@ module EgovUtils
11
14
  "#{fullname} (#{ico})"
12
15
  end
13
16
 
17
+ private
18
+
19
+ def strip_spaces_from_ico
20
+ self.ico = ico.to_s.gsub(/\s+/, '') if ico.present?
21
+ end
14
22
  end
15
23
  end
@@ -1,6 +1,5 @@
1
1
  module EgovUtils
2
2
  class Person < ApplicationRecord
3
-
4
3
  # This is kept for accepts_nested_attributes_for compatibility, but
5
4
  # overloaded below.
6
5
  has_one :residence, class_name: 'EgovUtils::Address'
@@ -3,6 +3,7 @@
3
3
  = bootstrap_form_tag(url: egov_utils.users_path, method: :get, layout: :inline) do |f|
4
4
  .form-group
5
5
  = f.text_field :search, value: params[:search], label: false, placeholder: t('label_search'), skip_label: true
6
+ = f.hidden_field :default_scope, value: params[:default_scope]
6
7
  = f.submit 'Vyhledat', class: 'btn btn-primary btn-sm'
7
8
 
8
9
  %table.table.table-striped
@@ -1,3 +1,3 @@
1
1
  module EgovUtils
2
- VERSION = '1.4.3'
2
+ VERSION = '1.4.5'
3
3
  end
@@ -25,5 +25,4 @@ FactoryBot.define do
25
25
  birth_date { Date.today - (Random.new.rand(50)+18).years }
26
26
  association :person, factory: :egov_utils_person
27
27
  end
28
-
29
28
  end
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.4.3
4
+ version: 1.4.5
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-01-17 00:00:00.000000000 Z
11
+ date: 2024-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -820,7 +820,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
820
820
  - !ruby/object:Gem::Version
821
821
  version: '0'
822
822
  requirements: []
823
- rubygems_version: 3.5.3
823
+ rubygems_version: 3.5.11
824
824
  signing_key:
825
825
  specification_version: 4
826
826
  summary: The eGoverment utilities is set of functionalities to support basic eGoverment