Commit dc825ac2 authored by Rodrigo Souto's avatar Rodrigo Souto

article: ensure comments fetch considers polymorphic relation

parent 2b9e1360
......@@ -77,7 +77,7 @@ class Article < ActiveRecord::Base
belongs_to :last_changed_by, :class_name => 'Person', :foreign_key => 'last_changed_by_id'
belongs_to :created_by, :class_name => 'Person', :foreign_key => 'created_by_id'
has_many :comments, :class_name => 'Comment', :foreign_key => 'source_id', :dependent => :destroy, :order => 'created_at asc'
has_many :comments, :class_name => 'Comment', :as => 'source', :dependent => :destroy, :order => 'created_at asc'
has_many :article_categorizations, -> { where 'articles_categories.virtual = ?', false }
has_many :categories, :through => :article_categorizations
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment