bulk_dependency_eraser 1.2.1 → 1.2.2

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: 72b5cd75c6792f0b2ef4b247c2fbc2e492e99aab3549bec64b8de9b9707b9a08
4
- data.tar.gz: 8884e4c9b65d4eede425d5d6b6cb8e7ff8e28877a9dc395657498ba44626bad0
3
+ metadata.gz: 80c6e41e13092670b6f67fc6cdb8d117c0222b0d2ce7c0043e1f12dcf01c1273
4
+ data.tar.gz: 9b93602042b1863caa6a1eac272547d76559e7ba62e97e29831c5d171050eafe
5
5
  SHA512:
6
- metadata.gz: edb16fcbfe2079074e2b2a35e2e5516718bb0b58c8fdd4db59d56606fd6c3951e98dd28b715065bc7fdd5b4cf3ad01576a49077b25b04eac2bcfd9d0e3e1d3a1
7
- data.tar.gz: 39f2aaa80dee40262d124883c1172f2e46c5ec850c2250ec11f1c76c0c8fbe72d6d8d76467ed35b09b30a255ef170bd4c34b28c6415304ac5864aed42e65f64d
6
+ metadata.gz: 26e795e7ecf8727eacf36267502454478922430dc86424f6ef0483bb195a09dc1c52c47067c0a87d70f9235173715a975422548ebd50da7fb1cf70ccbc7f0721
7
+ data.tar.gz: e6722b7ca1fd1c58f1b4a9d619af965eddb440c159bc2b9fd6efd436c2e927fd6e58679bb25f71438d24987aea8726ceb69a5ee081654e6cb8fbf4336d9c7dce
@@ -267,9 +267,24 @@ module BulkDependencyEraser
267
267
  reflection = parent_class.reflect_on_association(association_name)
268
268
  reflection_type = reflection.class.name
269
269
 
270
- if self.class::DEPENDENCY_DESTROY_IGNORE_REFLECTION_TYPES.include?(reflection_type)
271
- report_error("Dependency detected on #{parent_class.name}'s '#{association_name}' - association doesn't support dependency")
272
- return
270
+ is_polymorphic = reflection.options[:polymorphic]
271
+ unless is_polymorphic
272
+ klass = reflection.klass
273
+
274
+ if ignore_table_name_and_dependencies.include?(klass.table_name)
275
+ # Not parsing, table and dependencies ignorable
276
+ return
277
+ end
278
+
279
+ if ignore_klass_name_and_dependencies.include?(klass.name)
280
+ # Not parsing, table and dependencies ignorable
281
+ return
282
+ end
283
+
284
+ if self.class::DEPENDENCY_DESTROY_IGNORE_REFLECTION_TYPES.include?(reflection_type)
285
+ report_error("Dependency detected on #{parent_class.name}'s '#{association_name}' - association doesn't support dependency")
286
+ return
287
+ end
273
288
  end
274
289
 
275
290
  case reflection_type
@@ -1,3 +1,3 @@
1
1
  module BulkDependencyEraser
2
- VERSION = "1.2.1".freeze
2
+ VERSION = "1.2.2".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.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - benjamin.dana.software.dev@gmail.com