If a Problem with a polymorphic association and STI.

class Message < ActiveRecord::Base
  belongs_to :source, :polymorphic => true
end

class Letter < Message
end

class Post < ActiveRecord::Base
  has_many :messages, :as => :source
end

Post.first.messages works fine
Post.first.letters

Throws "NoMethodError: undefined method `letters' for
#<Post:0xb6671ef0>"

Thanks for your help.

lg
xinu
-- 
Posted via http://www.ruby-forum.com/.
-- 
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