views:

24

answers:

1

Hey folks,

I am having some trouble creating a nested association and I can't quite spot what's going on:

class Package < ActiveRecord::Base
  has_many :selections, :class_name => "PackageSelection"
  has_many :channels, :through => :selections
  has_many :categories, :through => :channels, :source => ?????
end

class Channel < ActiveRecord::Base
  belongs_to :category
  has_many :package_selections
  has_many :packages, :through => :package_selections 
end

class Category < ActiveRecord::Base
  has_many :channels
end

I am trying to figure out how to build the association to categories. Any advice?

A: 

It seems like this is impossible in Rails Core (currently 2.3) but someone has written a plugin to allow it

camwest