fix regression from 9ef506e731 with new posts
This commit is contained in:
@@ -801,7 +801,7 @@ class Post < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def post_is_not_its_own_parent
|
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"
|
errors[:base] << "Post cannot have itself as a parent"
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user