1

I have the following code

class Involvement < ActiveRecord::Base
   belongs_to  :matter
   belongs_to   :contact
end

class Contact < ActiveRecord::Base
    has_many :involvements, :order => "position", :dependent => :destroy
    has_many :matters, :through => :involvements, :source => :matter
end

class Matter < ActiveRecord::Base
    has_many :involvements
    has_many :plaintiffs, :through => :involvements, :source => :contact
    has_many :defendants, :through => :involvements, :source => :contact
end

I got the error while running the matters page.

ActiveRecord::HasManyThroughSourceAssociationNotFoundError in Matters#new

Could not find the source association(s) :contact in model Involvement. Try 'has_many :plaintiffs, :through => :involvements, :source => '. Is it one of ?

I have got this error while upgrade the rails 2.3.11 project in rails 3.0.10,

It works fine in rails 2.3.11 but I am unable to understand why it produces error in rails 3.0.10.

Any one know the solution of it, or reason why this breaks in rails 3.0.10

Matzi
  • 13,770
  • 4
  • 33
  • 50
Sapna
  • 11
  • 2

1 Answers1

0

I got the solution of it, actually in my model act_as_modified plug-in was using...

And as it deprecate in rails 3.0.10 it gives me the error, when I was removing it, all the association working fine...

Sapna
  • 11
  • 2