fix regression from 9ef506e731 with new posts

This commit is contained in:
r888888888
2013-04-30 17:41:57 -07:00
parent 3aafe32fb9
commit 59860750be

View File

@@ -801,7 +801,7 @@ class Post < ActiveRecord::Base
end
def post_is_not_its_own_parent
if id == parent_id
if parent_id.present? && id == parent_id
errors[:base] << "Post cannot have itself as a parent"
false
end