title: is this the cleanest approach for :has_many association to STI models in a module?
body: <p>The following works, but is it the cleanest approach?  </p>
  
  <p>In short, a Project :has_many Tasks.  Tasks are represented by an STI table and different subclasses of tasks are in the Task:: module (and subdirectory):</p>
  
  <pre><code># schema
  create_table projects do |t|
    # t.integer :id  - implicitly generated
  end
  create_table task_bases do |t|
    # t.integer :id  - implicitly generated
    t.string    :type        # for STI support
    t.integer   :project_id
  end
  
  # file: app/models/project.rb
  class Project &lt; ActiveRecord::Base
    :has_many :tasks, :class_name =&gt; "Task::Base", :dependent =&gt; :destroy
  end
  
  # file: app/models/task.rb
  module Task
    def self.table_name_prefix
      "task_"
    end
  end
  
  # file: app/models/task/base.rb
  module Task
    class Base &lt; ActiveRecord::Base
      :belongs_to :project
    end
  end
  
  # file app/models/task/priority.rb
  module Task
    class Priority &lt; Base
      :belongs_to :project
    end
  end
  </code></pre>
  
  <p>A couple of questions:</p>
  
  <ul>
  <li>Task::Base should never be instantiated -- we'll only use sub-classes of it.  I think this means that I declare it as an abstract_class -- what's the proper way to do that?</li>
  <li>Would it be better to name the STI table <code>tasks</code> rather than <code>task_bases</code>, and if so, what other changes need to happen?</li>
  <li>Should I be troubled by the <code>:class_name =&gt; "Task::Base"</code> declaration?</li>
  </ul>