Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

admin/feedback: make sure that "Mark checked item as (Ham|Spam)" do w…

…hat they say.

The behaviour of these was to just toggle the state, now they are
actually marking them as ham/spam so that they don't misbehave.
  • Loading branch information...
commit 1c09ab7c1c4e34cddb5588ca80b9ddcb13078eb4 1 parent 1f20a9e
@Flameeyes authored
View
4 app/controllers/admin/feedback_controller.rb
@@ -156,10 +156,10 @@ def bulkops
return
end
when 'Mark Checked Items as Ham'
- update_feedback(items, :change_state!)
+ update_feedback(items, :mark_as_ham!)
flash[:notice]= _("Marked %d item(s) as Ham",ids.size)
when 'Mark Checked Items as Spam'
- update_feedback(items, :change_state!)
+ update_feedback(items, :mark_as_spam!)
flash[:notice]= _("Marked %d item(s) as Spam",ids.size)
when 'Confirm Classification of Checked Items'
update_feedback(items, :confirm_classification!)
View
10 app/models/feedback.rb
@@ -130,6 +130,16 @@ def change_state!
result
end
+ def mark_as_ham!
+ mark_as_ham
+ save!
+ end
+
+ def mark_as_spam!
+ mark_as_ham
+ save!
+ end
+
def report_as_spam
report_as('spam')
end
Please sign in to comment.
Something went wrong with that request. Please try again.