I have problem with my code
class Post < ActiveRecord::Base end class NewsArticle < Post has_many :comments, :as => :commentable, :dependent =>
def commentable_type=(sType) super(sType.to_s.classify.constantize.base_class.to_s) end
This method is returning class as Post, what to do if you want to store the inherited class Post as commentable_type?