bulk_dependency_eraser 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/bulk_dependency_eraser/builder.rb +6 -5
- data/lib/bulk_dependency_eraser/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb8d638145b6ff810e2cb3deb79c11a134b9df5e6abdc25755a166d92158c583
|
4
|
+
data.tar.gz: 0f7525a93ddb69db0b0fdb1243973c2a1db1db1d33051fa3fe49e1aaefdb538d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8841e5385fdd92b2d1c14315d849df28a4d8af00a7d8f151a4e04767fd27a9b1cd1653d269912a23385520cb7eb18f8e4b483ab74c7f9a0a5249048fbb81f20b
|
7
|
+
data.tar.gz: c0701a14385970abc0ac5ec0025215a11c5818d391d2bcbef89c36e47c8f7a7919a6dbded77521efdb60108bdb88266ef21268e743265399d58c9a7c4044f648
|
@@ -427,11 +427,8 @@ module BulkDependencyEraser
|
|
427
427
|
assoc_query = assoc_query.where(specified_foreign_key.to_sym => query_ids)
|
428
428
|
end
|
429
429
|
|
430
|
-
#
|
431
|
-
|
432
|
-
# if opts[:limit]
|
433
|
-
# assoc_query = assoc_query.limit(opts[:limit])
|
434
|
-
# end
|
430
|
+
# remove any ordering or limits imposed on the association queries from the association definitions
|
431
|
+
assoc_query = assoc_query.reorder('').unscope(:limit)
|
435
432
|
|
436
433
|
if type == :delete
|
437
434
|
# Recursively call 'deletion_query_parser' on association query, to delete any if the assoc's dependencies
|
@@ -554,6 +551,9 @@ module BulkDependencyEraser
|
|
554
551
|
specified_primary_key.to_sym => foreign_keys
|
555
552
|
)
|
556
553
|
|
554
|
+
# remove any ordering or limits imposed on the association queries from the association definitions
|
555
|
+
assoc_query = assoc_query.reorder('').unscope(:limit)
|
556
|
+
|
557
557
|
if type == :delete
|
558
558
|
# Recursively call 'deletion_query_parser' on association query, to delete any if the assoc's dependencies
|
559
559
|
deletion_query_parser(assoc_query, parent_class)
|
@@ -572,6 +572,7 @@ module BulkDependencyEraser
|
|
572
572
|
# This method will replicate association_parser, but instantiate and iterate in batches
|
573
573
|
def association_parser_belongs_to_instantiation(parent_class, query, query_ids, association_name, type)
|
574
574
|
# pending
|
575
|
+
raise "Invalid State! Not ready to instantiate!"
|
575
576
|
end
|
576
577
|
|
577
578
|
# In this case, it's like a `belongs_to :polymorphicable, polymorphic: true, dependent: :destroy` use-case
|