bullet 7.1.1 → 7.1.2

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: f3337004db8160edc4f3fecbb4b9d9caf5db356f2bc53cbb8a87dc32661747db
4
- data.tar.gz: cf987a580af8f2451043a7ccc0ad0fd2f4f30b4832c8889e2a7891a85e1ed062
3
+ metadata.gz: 7c62bb5eb8bdfdb62ce49a79609ce7665d6af8be0f7dede7361379597415dcd4
4
+ data.tar.gz: 8da00673c07b79eb6dbf7b061aaf6dd0208fd0be841a96c3169ba919259fcf82
5
5
  SHA512:
6
- metadata.gz: 88ba85427aeb892d39b66d6f98edfa2dd1d80a23eba3080c2497b7b2b496add6cf3835239bc81b349a5176413fe771637e1218e72eca1d15b24f9f6cd737826d
7
- data.tar.gz: d3982d128702e65d65ec669be5a8ef0c15725e2f474db26911186aafedf6192f2278709cc1dee0f8d5857ca43105bb34fa6d2fa59eafaadb7b3284e5821a1388
6
+ metadata.gz: f33ad269a72ba293680c65ed460ef4e598446eebf62c82d79879de03b3cb52098f27499cab681facec3fdc3a3d6f937d064c21621aefcc69edcf499a52680838
7
+ data.tar.gz: 4a386c2bda2cdea90926ce9ff8bca0932954507ac4fa1e5986a356d869c3fb410b48708a5de843fb0e1f822f744ef1cf26dcecc9036ad3036f774ffad1c6e84e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Next Release
2
2
 
3
+ ## 7.1.2 (10/13/2023)
4
+
5
+ * Handle Rails 7.1 composite primary keys
6
+
3
7
  ## 7.1.1 (10/07/2023)
4
8
 
5
9
  * Add support for `Content-Security-Policy-Report-Only` nonces
@@ -9,12 +9,21 @@ class Object
9
9
  return if respond_to?(:persisted?) && !persisted?
10
10
 
11
11
  if self.class.respond_to?(:primary_keys) && self.class.primary_keys
12
- self.class.primary_keys.map { |primary_key| send primary_key }
13
- .join(',')
12
+ primary_key = self.class.primary_keys
14
13
  elsif self.class.respond_to?(:primary_key) && self.class.primary_key
15
- send self.class.primary_key
14
+ primary_key = self.class.primary_key
16
15
  else
17
- id
16
+ primary_key = :id
18
17
  end
18
+
19
+ bullet_join_potential_composite_primary_key(primary_key)
20
+ end
21
+
22
+ private
23
+
24
+ def bullet_join_potential_composite_primary_key(primary_keys)
25
+ return send(primary_keys) unless primary_keys.is_a?(Enumerable)
26
+
27
+ primary_keys.map { |primary_key| send primary_key }.join(',')
19
28
  end
20
29
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bullet
4
- VERSION = '7.1.1'
4
+ VERSION = '7.1.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.1.1
4
+ version: 7.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-07 00:00:00.000000000 Z
11
+ date: 2023-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport