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 +4 -4
- data/lib/bulk_dependency_eraser/builder.rb +18 -3
- 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: 80c6e41e13092670b6f67fc6cdb8d117c0222b0d2ce7c0043e1f12dcf01c1273
|
4
|
+
data.tar.gz: 9b93602042b1863caa6a1eac272547d76559e7ba62e97e29831c5d171050eafe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
271
|
-
|
272
|
-
|
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
|