Allow deleting of category, when there are only deleted articles left.
This commit is contained in:
parent
931bb1d7ca
commit
528295884e
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue