n1_loader 1.7.0 → 1.7.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35755dbc6a0ae17e636a26aaa99d903714a2e61248f60cc7a6c23f0d1ff5cbdd
|
4
|
+
data.tar.gz: 34ebd3c7c2d873fb42fce414c74055251ef6169df1a06ec6255a857598c8fdf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4233a0b750ccfa3e001b512a379fb5a68758c45117fdaa0b5ec9cfd1c84d344c7e261ee61927794db2246aaa6c40b9576d5a19d1e547e65f6e08eab21de903d
|
7
|
+
data.tar.gz: ee26e611bf87f7daf78912f01996bd7330a0dbb0d74e18a38af79b7f4869b6c43365694ef5f8597a8f1574e5cb16ff1ca4bf73421019215b29f139e4917510e9
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
## [1.
|
1
|
+
## [1.7.1] - 2023/07/30
|
2
|
+
|
3
|
+
- Fix interface discrepancy for `N1LoaderReflection`. Thanks [Denis Talakevich](https://github.com/senid231) for suggesting it!
|
4
|
+
|
5
|
+
## [1.7.0] - 2023/07/30
|
2
6
|
|
3
7
|
Extend the flexibility of loading data comparison. Thanks [Nazar Matus](https://github.com/FunkyloverOne) for suggesting it!
|
4
8
|
|
@@ -4,7 +4,7 @@ module N1Loader
|
|
4
4
|
module ActiveRecord
|
5
5
|
module Associations
|
6
6
|
module Preloader # :nodoc:
|
7
|
-
N1LoaderReflection = Struct.new(:
|
7
|
+
N1LoaderReflection = Struct.new(:name, :loader) do
|
8
8
|
def options
|
9
9
|
{}
|
10
10
|
end
|
@@ -12,7 +12,7 @@ module N1Loader
|
|
12
12
|
|
13
13
|
def preloaders_for_one(association, records, scope)
|
14
14
|
grouped_records(association, records).flat_map do |reflection, klasses|
|
15
|
-
next N1Loader::Preloader.new(records).preload(reflection.
|
15
|
+
next N1Loader::Preloader.new(records).preload(reflection.name) if reflection.is_a?(N1LoaderReflection)
|
16
16
|
|
17
17
|
klasses.map do |rhs_klass, rs|
|
18
18
|
loader = preloader_for(reflection, rs).new(rhs_klass, rs, reflection, scope)
|
@@ -4,7 +4,7 @@ module N1Loader
|
|
4
4
|
module ActiveRecord
|
5
5
|
module Associations
|
6
6
|
module Preloader # :nodoc:
|
7
|
-
N1LoaderReflection = Struct.new(:
|
7
|
+
N1LoaderReflection = Struct.new(:name, :loader) do
|
8
8
|
def options
|
9
9
|
{}
|
10
10
|
end
|
@@ -13,7 +13,7 @@ module N1Loader
|
|
13
13
|
def preloaders_for_reflection(reflection, records, scope)
|
14
14
|
return super unless reflection.is_a?(N1LoaderReflection)
|
15
15
|
|
16
|
-
N1Loader::Preloader.new(records).preload(reflection.
|
16
|
+
N1Loader::Preloader.new(records).preload(reflection.name)
|
17
17
|
end
|
18
18
|
|
19
19
|
def grouped_records(association, records, polymorphic_parent)
|
@@ -4,7 +4,7 @@ module N1Loader
|
|
4
4
|
module ActiveRecord
|
5
5
|
module Associations
|
6
6
|
module Preloader # :nodoc:
|
7
|
-
N1LoaderReflection = Struct.new(:
|
7
|
+
N1LoaderReflection = Struct.new(:name, :loader) do
|
8
8
|
def options
|
9
9
|
{}
|
10
10
|
end
|
@@ -13,7 +13,7 @@ module N1Loader
|
|
13
13
|
def preloaders_for_reflection(reflection, records)
|
14
14
|
return super unless reflection.is_a?(N1LoaderReflection)
|
15
15
|
|
16
|
-
N1Loader::Preloader.new(records).preload(reflection.
|
16
|
+
N1Loader::Preloader.new(records).preload(reflection.name)
|
17
17
|
end
|
18
18
|
|
19
19
|
def grouped_records # rubocop:disable Metrics/PerceivedComplexity, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/AbcSize
|
data/lib/n1_loader/version.rb
CHANGED