diff --git a/lib/inherited_resources/polymorphic_helpers.rb b/lib/inherited_resources/polymorphic_helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/inherited_resources/polymorphic_helpers.rb
+++ b/lib/inherited_resources/polymorphic_helpers.rb
@@ -102,11 +102,13 @@ module InheritedResources
       # as parent types.
       #
       def parent_type
-        unless @parent_type
+        unless instance_variable_defined?(:@parent_type)
           symbols_for_association_chain
         end
 
-        @parent_type
+        if instance_variable_defined?(:@parent_type)
+          @parent_type
+        end
       end
 
       def parent_class
Fix undefined instance variable @parent_type warning

When running the test suite, the following warning appears *many* times:

```
warning: instance variable @parent_type not initialized
```

We have to wrap both in conditionals because if you review `symbols_for_association_chain` carefully it may not set the instance variable leaving it in a still undefined state. In case it is, we fall on the default behavior of returning nil. This is passes all the tests while removing all warnings for this variable.