I have two models, Article and Post, that has many Comments.  However,
both Article and Post are inherited from a BaseContent class like so:

class Article < BaseContent
  has_many :comments, :as => :commentable
end

class Post < BaseContent
  has_many :comments, :as => :commentable
end

and here's my Comment model:

class Comment < ActiveRecord::Base
  belongs_to :commentable, :polymorphic => true
end

Now when I try to associate a comment with an Article or Post, the
commentable_type field gets set as "BaseContent" instead of "Article"
or "Post."  Is there a way to specify what the commentable_type field
is?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to