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: e9be9c5e7d5e551d253a327cd3d130a38821ef49a43cab60235cc5363a4093d0
4
- data.tar.gz: 55c8e748bf52fc05b8648d81d907963b4a60eae0b7aa680d0c491987b43303d3
3
+ metadata.gz: 35755dbc6a0ae17e636a26aaa99d903714a2e61248f60cc7a6c23f0d1ff5cbdd
4
+ data.tar.gz: 34ebd3c7c2d873fb42fce414c74055251ef6169df1a06ec6255a857598c8fdf7
5
5
  SHA512:
6
- metadata.gz: b626c836856198a9e0d0f54daedd0299b2cd7eb0648ddde369a6b7f923751b31d402c8ba03ab67bb064b884e5c5f035babcd1f59d0bef93db26968f7e6fca7ae
7
- data.tar.gz: 640e8decd4c53e4f09451041392b964b5f0e59a273719673978e4bf62d26543364b5b4166d97833b7a5084ebacfe7921a921a5c0aae3938c3ce9394f6627bfc8
6
+ metadata.gz: b4233a0b750ccfa3e001b512a379fb5a68758c45117fdaa0b5ec9cfd1c84d344c7e261ee61927794db2246aaa6c40b9576d5a19d1e547e65f6e08eab21de903d
7
+ data.tar.gz: ee26e611bf87f7daf78912f01996bd7330a0dbb0d74e18a38af79b7f4869b6c43365694ef5f8597a8f1574e5cb16ff1ca4bf73421019215b29f139e4917510e9
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ## [1.6.7] - 2023/07/30
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(:key, :loader) do
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.key) if reflection.is_a?(N1LoaderReflection)
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(:key, :loader) do
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.key)
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(:key, :loader) do
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.key)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module N1Loader
4
- VERSION = "1.7.0"
4
+ VERSION = "1.7.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: n1_loader
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Demin