Topic: Has_many :through errors
Okay, I've worked it out. It was because I put :tasks and :documents in one line. Figured I'd leave this up in case anyone makes the same mistake.
I've converted one of my HABTM associations to has_many :through. With lots of code missed out here's what I've got:
class Document < ActiveRecord::Base
has_many :tasks, :through => :resourceds
class Task < ActiveRecord::Base
has_many :documents, :through => :resourceds
class Resourced < ActiveRecord::Base
has_many :tasks, :documents
I've tried running my old unit tests to check I haven't broken too much and I'm getting a strange error:
LoadError: Expected *pathtomodelsdirectory*/resourced.rb to define Resourced.
But resourced.rb exists.
Last edited by Draconid (2007-01-29 10:19:02)