Hi I have three tables like the following:
class Workitem < ActiveRecord::Base
has_many :effort
attr_protected
end
class Effort < ActiveRecord::Base
attr_protected
belongs_to :workitem
belongs_to :person
end
class Person < ActiveRecord::Base
attr_accessible :given_name, :mgrid, :surname, :id
has_many :effort
end
The idea is to keep track of how many days a person has spent on a particular work item through efforts table. Could somebody verify if my relationships are correct? But this doesn't seem to work. Am I missing something here?
Also, I can't understand the has_many :through
kind of associations. Can somebody please give me an idea if that is what I'm supposed to use in this case?