1) Removed the published boolean database field

2) Replaced it with a string field (state) which contains the state of the comment. i.e. published, unpublished, spam.  Unsure if we want to create constants in comments.php to standardize the valid values... thoughts?
3) synchronized the spamfilter and comment unit tests with the current functionality
This commit is contained in:
Tim Almdal
2009-01-02 18:54:37 +00:00
parent 277e7f8db2
commit 9644dcc480
6 changed files with 9 additions and 12 deletions
+3 -2
View File
@@ -30,7 +30,7 @@ class Comments_Controller extends REST_Controller {
$comments = ORM::factory("comment")
->where("item_id", $item->id)
->where("published", 1)
->where("state", "published")
->orderby("created", "desc")
->find_all();
@@ -68,7 +68,8 @@ class Comments_Controller extends REST_Controller {
print json_encode(
array("result" => "success",
"resource" => $comment->published ? url::site("comments/{$comment->id}") : NULL,
"resource" => $comment->state == "published" ? url::site("comments/{$comment->id}") :
NULL,
"form" => comment::get_add_form($item)->__toString()));
} else {
print json_encode(