bulk_dependency_eraser 1.3.2 → 1.3.3

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: 7e0b2a7c10501166d33e7076cf19b7c241ffd9de2704d94aca6f7c9fecc6e2d4
4
- data.tar.gz: 6788ed915a4a6b4f7d7dbe2c8387244b0ff5e758098fe48f47b47127e64d9fb5
3
+ metadata.gz: bb8d638145b6ff810e2cb3deb79c11a134b9df5e6abdc25755a166d92158c583
4
+ data.tar.gz: 0f7525a93ddb69db0b0fdb1243973c2a1db1db1d33051fa3fe49e1aaefdb538d
5
5
  SHA512:
6
- metadata.gz: ab13a12a9e5965890ae2e27cbf0971ba75aec2dbdc463d92c1631ac9cdb6dd98729e22cedb9c05cfb4cd4f897ca774c5204d0c3a61c804f8f7f8961de4e686cb
7
- data.tar.gz: 9d0968970dd212e9e07c459134e829c8b1fd17c3c65d2b1e7665f983a68c4655044e3732ce7e2f6d28fb0c0e59606ffde0f343761a4730abb2f6dc74c3ba521d
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
- # Works in theory for ONE record's has_one, but we're dealing with potentially many
431
- # # Apply limit if has_one assocation (subset of has_many)
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
@@ -1,3 +1,3 @@
1
1
  module BulkDependencyEraser
2
- VERSION = "1.3.2".freeze
2
+ VERSION = "1.3.3".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bulk_dependency_eraser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - benjamin.dana.software.dev@gmail.com