From ffc01af6a6f2985905d3ae1a05e30754476ef6c0 Mon Sep 17 00:00:00 2001 From: Rada Bogdan Date: Sun, 21 Feb 2021 20:29:06 +0200 Subject: [PATCH] Filter also classes that are abstract --- lib/washout_builder/document/shared_complex_type.rb | 6 +++++- lib/washout_builder/version.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/washout_builder/document/shared_complex_type.rb b/lib/washout_builder/document/shared_complex_type.rb index 69da917..d764998 100644 --- a/lib/washout_builder/document/shared_complex_type.rb +++ b/lib/washout_builder/document/shared_complex_type.rb @@ -8,7 +8,11 @@ module SharedComplexType # @param [Array] array The array of classes that should be fitered from the ancestors if they are present # @return [Array] The classes from which the class given as first argument inherits from but filtering the classes passed as second argument def get_complex_type_ancestors(class_name, array) - (class_name.ancestors - class_name.included_modules).delete_if { |x| x.to_s.downcase == class_name.to_s.downcase || array.include?(x.to_s) } + (class_name.ancestors - class_name.included_modules).delete_if do |x| + x.to_s.downcase == class_name.to_s.downcase || + array.include?(x.to_s) || + (x.respond_to?(:abstract_class) && x.abstract_class) + end end end end diff --git a/lib/washout_builder/version.rb b/lib/washout_builder/version.rb index 26bfb9e..c592584 100644 --- a/lib/washout_builder/version.rb +++ b/lib/washout_builder/version.rb @@ -12,7 +12,7 @@ module VERSION # the minor version of the gem MINOR = 0 # the tiny version of the gem - TINY = 4 + TINY = 5 # if the version should be a prerelease PRE = nil