batch-loader-active-record 0.4.0 → 0.4.1
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/Gemfile.lock +1 -1
- data/lib/batch_loader_active_record/association_manager.rb +3 -1
- data/lib/batch_loader_active_record/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7d1ba39cf3a3de836849d980d1f31815990d6e0
|
4
|
+
data.tar.gz: ce551c5339a932ba20dda200364e2789f644bafb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 386454aeb0a0152f309eb5922a6cb629546d06e3228830257038fc2770d6102eb6a347eda3d19885a34d6c868825e1f83ae2e607d2d16b655301366f73c1d11d
|
7
|
+
data.tar.gz: 4a98d66b1cf4c93045856335572cd642daee0493106c02ab169946f1dde2cb016f63a012c5a56e85ddd682e7a2f0bbbe30ed6ef02028b7bd4a5f5ea6813afcd6
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -46,7 +46,9 @@ module BatchLoaderActiveRecord
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def has_and_belongs_to_many_to_batch_loader(instance, instance_scope)
|
49
|
-
|
49
|
+
custom_key = batch_key
|
50
|
+
custom_key += [instance_scope.to_sql.hash] unless instance_scope.nil?
|
51
|
+
BatchLoader.for(instance.id).batch(default_value: [], key: custom_key) do |model_ids, loader|
|
50
52
|
instance_id_path = "#{reflection.join_table}.#{reflection.foreign_key}"
|
51
53
|
relation_with_scope(instance_scope)
|
52
54
|
.joins(habtm_join(reflection))
|