From 148d2f2cd488f5b8658c8682659c51a9af04d5e9 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 26 Jun 2013 16:00:17 +1000 Subject: [PATCH] bug fixes --- app/assets/javascripts/admin/models/flagged_post.js | 8 ++++---- spec/models/post_action_spec.rb | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/admin/models/flagged_post.js b/app/assets/javascripts/admin/models/flagged_post.js index 3facc7685d0..dccc324977b 100644 --- a/app/assets/javascripts/admin/models/flagged_post.js +++ b/app/assets/javascripts/admin/models/flagged_post.js @@ -10,7 +10,7 @@ Discourse.FlaggedPost = Discourse.Post.extend({ summary: function(){ return _(this.post_actions) - .groupBy(function(a){ return a.post_action_type_id }) + .groupBy(function(a){ return a.post_action_type_id; }) .map(function(v,k){ return Em.String.i18n("admin.flags.summary.action_type_" + k, {count: v.length}); }) @@ -52,7 +52,7 @@ Discourse.FlaggedPost = Discourse.Post.extend({ }.property(), topicHidden: function() { - return this.get('topic_visible') === 'f'; + return !this.get('topic_visible'); }.property('topic_hidden'), deletePost: function() { @@ -76,11 +76,11 @@ Discourse.FlaggedPost = Discourse.Post.extend({ }, postHidden: function() { - return (this.get('hidden') === "t"); + return (this.get('hidden')); }.property(), hiddenClass: function() { - if (this.get('hidden') === "t") return "hidden-post"; + if (this.get('hidden')) return "hidden-post"; }.property() }); diff --git a/spec/models/post_action_spec.rb b/spec/models/post_action_spec.rb index 08a34cc7c3b..e32760925cf 100644 --- a/spec/models/post_action_spec.rb +++ b/spec/models/post_action_spec.rb @@ -16,7 +16,6 @@ describe PostAction do it "operates correctly" do PostAction.act(codinghorror, post, PostActionType.types[:spam]) posts, users = PostAction.flagged_posts_report("") - p posts posts.count.should == 1 users.count.should == 2 end