prefixed_ids 1.6.0 → 1.6.1

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: 16d022537d510bcdcea78b0923d63c446e1b5fa85a5de1498f5206d6c8e1a935
4
- data.tar.gz: 9c4d0267908842cc93d498320628916a8ba966a72634730e6eeade8ab70ffa3d
3
+ metadata.gz: afa295f257c683531956a2cb9d576c15a17daa215917e053552a2debe8c5645c
4
+ data.tar.gz: 9e232d13a6675324217539ea4b2320f1a406ade6762aacef552f66d33d780f42
5
5
  SHA512:
6
- metadata.gz: 1c6ea5a2cb678238a2ee0102459d40c4d1c89755d69eddbca34e8c54b68ce455f08dd35c07b2c3fe381ddb4528d3913a0b50190bd45457baa18d102ee2c72a69
7
- data.tar.gz: 4743147c32367f459b0eced1fd7959ce36cfbc55061ae85e50a858ed0a46e0269bc25a0763dbed68d928af4ad84ccd8e3656c3c3759a0609b1627be5326a08b6
6
+ metadata.gz: 1a88c09cea33f417b70bb5022ddc6a64dcc0125b4ec13f657db0b99aab899c5d510cfe61afc5a72df559dd31152ae59771315686d3695189108ca11bb723c216
7
+ data.tar.gz: 759d7c033de37807e08fef5f0c97731dfaddb8f8e0a718cfa8d78dea7fd8239955110d985065042e1a26d477bd18fb45bd9278e1f3e43e075db59c17860cc3fc
@@ -1,3 +1,3 @@
1
1
  module PrefixedIds
2
- VERSION = "1.6.0"
2
+ VERSION = "1.6.1"
3
3
  end
data/lib/prefixed_ids.rb CHANGED
@@ -91,14 +91,16 @@ module PrefixedIds
91
91
 
92
92
  class_methods do
93
93
  def find(*ids)
94
- prefix_ids = *ids.map do |id|
95
- # Skip if model doesn't use prefixed ids
96
- next id unless _prefix_id.present?
94
+ # Skip if model doesn't use prefixed ids
95
+ return super if _prefix_id.blank?
97
96
 
97
+ prefix_ids = ids.flatten.map do |id|
98
98
  prefix_id = _prefix_id.decode(id, fallback: _prefix_id_fallback)
99
99
  raise Error, "#{id} is not a valid prefix_id" if !_prefix_id_fallback && prefix_id.nil?
100
100
  prefix_id
101
101
  end
102
+ prefix_ids = [prefix_ids] if ids.first.is_a?(Array)
103
+
102
104
  super(*prefix_ids)
103
105
  end
104
106
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prefixed_ids
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Oliver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-24 00:00:00.000000000 Z
11
+ date: 2023-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.4.13
111
+ rubygems_version: 3.4.22
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Prefixed IDs generates IDs with friendly prefixes for your models