Allow deleting of category, when there are only deleted articles left.

This commit is contained in:
Benjamin Meichsner 2013-03-17 20:11:57 +01:00
parent 931bb1d7ca
commit 528295884e

View file

@ -8,7 +8,7 @@ class ArticleCategory < ActiveRecord::Base
protected protected
def check_for_associated_articles def check_for_associated_articles
raise I18n.t('activerecord.errors.has_many_left', collection: Article.model_name.human) if articles.exists? raise I18n.t('activerecord.errors.has_many_left', collection: Article.model_name.human) if articles.undeleted.exists?
end end
end end