I have 3 models:
class Result < ActiveRecord::Base
has_many :articles, :through => :collections
class Article < ActiveRecord::Base
has_many :results, :through => :collections
class Collection < ActiveRecord::Base
Collection has a table like this:
create_table :collections do |t|
t.column :id, :integer
t.column :result_id, :integer
t.column :article_id, :integer
t.column :extract, :text
The problem i have is this.
I do a find for a single result.
Then i go through each article in this result, using the each method.
At this point i’m outputting all the attributes of articles.
But i want to also output the extract for this article and result.
How would i do this?
article.extract doesn’t work, nor does article.results.extract
Thanks for your help.