better explicit check for existence of parent

This commit is contained in:
r888888888
2013-06-05 15:04:31 -07:00
parent ca5cdb18fc
commit 4bbfc307c3
2 changed files with 5 additions and 1 deletions

View File

@@ -820,6 +820,10 @@ class Post < ActiveRecord::Base
false
end
end
def parent_exists?
Post.exists?(parent_id)
end
end
module DeletionMethods