gizzard 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/gizzard/base.rb +8 -0
- data/lib/gizzard/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7835d4c05720dfbe30c00af4019b823ce0e5098c4151ced2744147272bbddd87
|
4
|
+
data.tar.gz: 6735ab05f95da9f5ac49846f33856fba7d7efb3a34803a344e5ec3c78097b94a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 316d1946ed962e152b33aae18b72188d4b4ae04495d5da3184db902143a95dd93534ff401ddb4cbd71b78bf7711c08cb7b3511dee29d1f6ca8b8fcf88cce1ed5
|
7
|
+
data.tar.gz: 30ee2722af67585d7888257bcb04aae0dd8850077e1c8104b1734db3080d1003e32da7b52aa7aac9758c53290aaf79394fc73e30fd2ae25aa6d2a86629a60143
|
data/README.md
CHANGED
data/lib/gizzard/base.rb
CHANGED
@@ -3,6 +3,14 @@ module Gizzard
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
class_methods do
|
6
|
+
def preload_associations(records:, associations:, scope: nil)
|
7
|
+
if Gem::Version.new(ActiveRecord::VERSION::STRING) >= Gem::Version.new(7)
|
8
|
+
ActiveRecord::Associations::Preloader.new(records: records, associations: associations, scope: scope).call
|
9
|
+
else
|
10
|
+
ActiveRecord::Associations::Preloader.new.preload(records, associations, scope)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
6
14
|
def delete_all_by_id(batch_size: 1000)
|
7
15
|
ids = pluck(:id)
|
8
16
|
ids.sort!
|
data/lib/gizzard/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gizzard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takahiro Ooishi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -211,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
211
211
|
- !ruby/object:Gem::Version
|
212
212
|
version: '0'
|
213
213
|
requirements: []
|
214
|
-
rubygems_version: 3.
|
214
|
+
rubygems_version: 3.1.6
|
215
215
|
signing_key:
|
216
216
|
specification_version: 4
|
217
217
|
summary: Often use snippet for ActiveRecord.
|