egov_utils 0.6.3 → 0.6.4

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: 9b19c8d6e9175e5b472c8b821d611c8cf7e3a19ee1dce31d8056b368bb367fec
4
- data.tar.gz: 5dbcfd93cc21019f96569688aac9023032e9c6900617882b0de4352e87525ce8
3
+ metadata.gz: 15c9bb03cd2bb748b5d32a2ff051bd1083028d19f4c69c65637112722b871bcf
4
+ data.tar.gz: c160099429bee03754890907732dce50704f0430cb3bebcb2b3912f64d03a0ce
5
5
  SHA512:
6
- metadata.gz: 6fcb6a35215f2dbbb0d5468551d21b492d03ee15a5a885758d8ac340cba4cdfed1c0c3d0f9f03b3b7c7e20c171866147e201c42cd82b8e781fbaba8f76e5be5d
7
- data.tar.gz: 3570ce94d514b715bb68016264488bb4f3cfc4a65f11d1deed2a347c90c167442cc4368f11a17485db955d6c9d7f06fdf1d00ea19d95e577a9a81c4fb3eeb25b
6
+ metadata.gz: 3833e1edb4557b8d67b3c102f3861c86f965ae9530f04af2ea37b654a13cc88b67f2f8a195675e243c46ea5e785765e58449a1c8e4f60466ddc0e139eb531de2
7
+ data.tar.gz: 2c678e87567ac4ee0a774463a0f92ccb93c973c380675db3b8400e0519eaa9a3923943ed5fce5dbef597d55e771759aaeac842fb8b332f1eef9227035a751d77
@@ -14,10 +14,12 @@ module EgovUtils
14
14
  all.detect{ |o| o.key == key }
15
15
  end
16
16
 
17
- def self.courts(organization_keys=nil)
17
+ def self.courts(organization_keys=nil, include_branches: true)
18
18
  all.select do |o|
19
19
  %w{OS KS MS}.include?(o.category_abbrev) &&
20
20
  (organization_keys.nil? || organization_keys.include?(o.key))
21
+ end.tap do |collection|
22
+ collection.select { _1.branch_of_id.nil? } unless include_branches
21
23
  end
22
24
  end
23
25
 
@@ -34,9 +36,10 @@ module EgovUtils
34
36
  where(key: key).first
35
37
  end
36
38
 
37
- def self.courts(organization_keys=nil)
39
+ def self.courts(organization_keys=nil, include_branches: true)
38
40
  filters = {category_abbrev: ['OS','KS', 'MS']}
39
41
  filters.merge!(key: organization_keys) if organization_keys.present?
42
+ filters.merge!(branch_of_id: [nil]) unless include_branches
40
43
  all(params: {f: filters, sort: {'0' => {path: 'category_abbrev'} }})
41
44
  end
42
45
 
@@ -1,3 +1,3 @@
1
1
  module EgovUtils
2
- VERSION = '0.6.3'
2
+ VERSION = '0.6.4'
3
3
  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: 0.6.3
4
+ version: 0.6.4
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: 2021-11-29 00:00:00.000000000 Z
11
+ date: 2021-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails