Commit 56ce87a7f7418c086f2d6535faf905cd191886a7

Authored by Leandro Santos
1 parent a93b0665
Exists in staging and in 1 other branch production

fix comments bug

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
plugins/comment_group/lib/ext/article.rb
... ... @@ -10,7 +10,7 @@ class Article
10 10  
11 11 def not_empty_group_comments_removed
12 12 if body && body_changed?
13   - groups_with_comments = Comment.select('DISTINCT group_id').where(source_id: self.id).map(&:group_id).compact
  13 + groups_with_comments = Comment.select('DISTINCT comments.group_id').where(source_id: self.id).map(&:group_id).compact
14 14 groups = Nokogiri::HTML.fragment(body.to_s).css('.macro').collect{|element| element['data-macro-group_id'].to_i}
15 15 errors[:base] << (N_('Not empty group comment cannot be removed')) unless (groups_with_comments-groups).empty?
16 16 end
... ...