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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/bullet/ext/object.rb +13 -4
- data/lib/bullet/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c62bb5eb8bdfdb62ce49a79609ce7665d6af8be0f7dede7361379597415dcd4
|
4
|
+
data.tar.gz: 8da00673c07b79eb6dbf7b061aaf6dd0208fd0be841a96c3169ba919259fcf82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f33ad269a72ba293680c65ed460ef4e598446eebf62c82d79879de03b3cb52098f27499cab681facec3fdc3a3d6f937d064c21621aefcc69edcf499a52680838
|
7
|
+
data.tar.gz: 4a386c2bda2cdea90926ce9ff8bca0932954507ac4fa1e5986a356d869c3fb410b48708a5de843fb0e1f822f744ef1cf26dcecc9036ad3036f774ffad1c6e84e
|
data/CHANGELOG.md
CHANGED
data/lib/bullet/ext/object.rb
CHANGED
@@ -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
|
13
|
-
.join(',')
|
12
|
+
primary_key = self.class.primary_keys
|
14
13
|
elsif self.class.respond_to?(:primary_key) && self.class.primary_key
|
15
|
-
|
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
|
data/lib/bullet/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2023-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|