rubyonrails-talk
August 31st, 2006, 12:28 PM
Hi,
I am having trouble using STI and polymorphism together. I tried
"has_many :as" without success so I am trying to be more explicit.
Here is what I have now
class Visual < ActiveRecord::Base
has_many :tags,
:foreign_key=>'resource_id',
:conditions=>['resource_type = ?', self.class.to_s],
More... (http://groups.google.com/group/rubyonrails-talk/msg/e6eed4ff0253f45b)
I am having trouble using STI and polymorphism together. I tried
"has_many :as" without success so I am trying to be more explicit.
Here is what I have now
class Visual < ActiveRecord::Base
has_many :tags,
:foreign_key=>'resource_id',
:conditions=>['resource_type = ?', self.class.to_s],
More... (http://groups.google.com/group/rubyonrails-talk/msg/e6eed4ff0253f45b)