bulk_dependency_eraser 1.0.4 → 1.0.5

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: cc034a38ab80a2e277860a5a69f6a654e1e461f691f54d6a510814b55279cebd
4
- data.tar.gz: 88055bcbcb73bc260ef4718006f3149d95ea216badb4bd4ac142506e756c1882
3
+ metadata.gz: cbea15215c816eca6790c1d7c3cbf4f4f68534fc3ff18cc38e8c26dc7e94513d
4
+ data.tar.gz: 532a711c1290ea4fea4200acc75d9916eb18a2451207b89d1163372d7372028d
5
5
  SHA512:
6
- metadata.gz: 0c9d1bc7851eaa2f51a853a99b24ff3842940f792938b2eac86ebfcc6471653c0d14de735d837f108ca59118a6661c086566b48475b87f1c98870cd80544dd79
7
- data.tar.gz: 7e09f55e2baf0db2eefd7f2dfc028fda58b7f9ec2469a6bdbcfa56855bd4cf1ddc0b1502468554f56726fcbd08135daecc5e20940d18b2d9a2f49dc2558c5971
6
+ metadata.gz: e5639d23e7fbad812f11db05ad4b4dc3e88cd8823b3623ec38c892ed144ca6002b2e6bf56a826cca62aa2e87312fc676ac0668d1d6301a66496f91a62c7896fe
7
+ data.tar.gz: 20f81c4ddae6e875de07849088493f21095a567ccf2e1e39bfe21bbe1486dbfaa76ad06bc53f247724ca0f5e79a7f7af699e480345c2b5a800f617c06bb83844
@@ -260,7 +260,7 @@ module BulkDependencyEraser
260
260
  when 'ActiveRecord::Reflection::HasManyReflection'
261
261
  association_parser_has_many(parent_class, query, query_ids, association_name, type)
262
262
  when 'ActiveRecord::Reflection::HasOneReflection'
263
- association_parser_has_many(parent_class, query, query_ids, association_name, type, { limit: 1 })
263
+ association_parser_has_many(parent_class, query, query_ids, association_name, type)
264
264
  when 'ActiveRecord::Reflection::BelongsToReflection'
265
265
  if type == :nullify
266
266
  report_error("#{parent_class.name}'s association '#{association_name}' - dependent 'nullify' invalid for 'belongs_to'")
@@ -347,10 +347,11 @@ module BulkDependencyEraser
347
347
  assoc_query = assoc_query.where(specified_foreign_key.to_sym => query_ids)
348
348
  end
349
349
 
350
- # Apply limit if has_one assocation (subset of has_many)
351
- if opts[:limit]
352
- assoc_query = assoc_query.limit(opts[:limit])
353
- end
350
+ # Works in theory for ONE record's has_one, but we're dealing with potentially many
351
+ # # Apply limit if has_one assocation (subset of has_many)
352
+ # if opts[:limit]
353
+ # assoc_query = assoc_query.limit(opts[:limit])
354
+ # end
354
355
 
355
356
  if type == :delete
356
357
  # Recursively call 'deletion_query_parser' on association query, to delete any if the assoc's dependencies
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.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - benjamin.dana.software.dev@gmail.com