diff --git a/lib/closure_tree/support.rb b/lib/closure_tree/support.rb index 75108d7..04cf06b 100644 --- a/lib/closure_tree/support.rb +++ b/lib/closure_tree/support.rb @@ -33,7 +33,7 @@ def initialize(model_class, options) def hierarchy_class_for_model parent_class = ActiveSupport::VERSION::MAJOR >= 6 ? model_class.module_parent : model_class.parent - hierarchy_class = parent_class.const_set(short_hierarchy_class_name, Class.new(ActiveRecord::Base)) + hierarchy_class = parent_class.const_set(short_hierarchy_class_name, Class.new(model_class.superclass)) use_attr_accessible = use_attr_accessible? include_forbidden_attributes_protection = include_forbidden_attributes_protection? model_class_name = model_class.to_s