Permalink
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...
Flameeyes committed Feb 17, 2013
1 parent 1f20a9e commit 1c09ab7c1c4e34cddb5588ca80b9ddcb13078eb4
Showing with 12 additions and 2 deletions.
  1. +2 −2 app/controllers/admin/feedback_controller.rb
  2. +10 −0 app/models/feedback.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
@@ -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

0 comments on commit 1c09ab7

Please sign in to comment.