Rails STI namespaced classes without using type column
<p>I am trying to implement STI as follows</p>

<pre><code>module ModuleName
  class ParentName
    self.inheritance_column = 'column_name'
  end
end

module ModuleName
  class ChildName &lt; ModuleName::ParentName
    class &lt;&lt; self
      def find_sti_class(type_name)
        type_name = self.name
        super
      end

      def sti_name
        self.name.sub(/^.*:/,"")
      end
    end
end
</code></pre>

<p>When I try </p>

<pre><code>ModuleName::ChildName.create(column_name: 'ChildName')
</code></pre>

<p>I am getting following error</p>

<pre><code>ActiveRecord::SubclassNotFound: Invalid single-table inheritance type: ChildName is not a subclass of ModuleName::ChildName
</code></pre>

<p>I was trying to refer to solution provided here
<a href="https://stackoverflow.com/questions/23293177/rails-sti-how-to-change-mapping-between-class-name-value-of-the-type-column">Rails STI: How to change mapping between class name &amp; value of the &#39;type&#39; column</a></p>

<p>Any help appreciated. Thanks. </p>