Commit ab6a50b411f17431843c19ef5b4f31eee478e0f6
1 parent
09af991b
Exists in
master
comment_paragraph: fix article validation
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
lib/ext/article.rb
| @@ -8,7 +8,7 @@ class Article | @@ -8,7 +8,7 @@ class Article | ||
| 8 | 8 | ||
| 9 | def body_change_with_comments | 9 | def body_change_with_comments |
| 10 | if body && body_changed? && !self.comments.empty? | 10 | if body && body_changed? && !self.comments.empty? |
| 11 | - paragraphs_with_comments = self.comments.where("'paragraph_id' IS NOT NULL") | 11 | + paragraphs_with_comments = self.comments.where("paragraph_id IS NOT NULL") |
| 12 | errors[:base] << (N_('You are unable to change the body of the article when paragraphs are commented')) unless (paragraphs_with_comments).empty? | 12 | errors[:base] << (N_('You are unable to change the body of the article when paragraphs are commented')) unless (paragraphs_with_comments).empty? |
| 13 | end | 13 | end |
| 14 | end | 14 | end |