Commit 2314732fd3204608e963f6d032d515b97ef66ce5

Authored by Rodrigo Souto
1 parent 6982dcf6

article: ensure comments fetch considers polymorphic relation

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
app/models/article.rb
... ... @@ -77,7 +77,7 @@ class Article < ActiveRecord::Base
77 77 belongs_to :last_changed_by, :class_name => 'Person', :foreign_key => 'last_changed_by_id'
78 78 belongs_to :created_by, :class_name => 'Person', :foreign_key => 'created_by_id'
79 79  
80   - has_many :comments, :class_name => 'Comment', :foreign_key => 'source_id', :dependent => :destroy, :order => 'created_at asc'
  80 + has_many :comments, :class_name => 'Comment', :as => 'source', :dependent => :destroy, :order => 'created_at asc'
81 81  
82 82 has_many :article_categorizations, :conditions => [ 'articles_categories.virtual = ?', false ]
83 83 has_many :categories, :through => :article_categorizations
... ...