Displaying 1 result from an estimated 1 matches for "poymorph".
Did you mean:
polymorph
2006 Aug 16
0
Polymorphic Associations and grouping users and projects
...:groupabale
has_many :groups, :through => :memberships
end
class Project < ActiveRecord::Base
has_many :memberships, :as => :groupable
has_many :groups, :through => :memberships
end
class Membership < ActiveRecord::Base
belongs_to :group
belongs_to :groupable, :poymorphic => true
end
class Group < ActiveRecord::Base
has_many :memberships
end
Thanks for your input!
--
Posted via http://www.ruby-forum.com/.