Has_many :through distant associations

I have the following associations:

disks->disks_user_files<-user_files

my models look like:

class Disk < ActiveRecord::Base
has_many :disk_user_files
has_many :user_files, through=>:disk_user_files
end

class DiskUserFile < ActiveRecord::Base
belongs_to :disk
belongs_to :user_files
end

class UserFile < ActiveRecord::Base
has_many disk_user_files

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs