Commit
f49dbb2e6fe689f008864e6f1a0e786b98e2043d
Exists in
master
and in
29 other branches
add_member_task_reject_details, admin_visible_profile, article-list-template, community_notifications, contact_admin_translation, event_fixes, fix_comments_pagination, fix_rails4_organization_ratings, fix_sign_up_form, follow_step_fix, forum_topic_creation, mirror_block_improvements, multi_env_on_remote_user, new_security, noosfero_spb_ci, organization_ratings_improvements, organization_ratings_link_to_profile_stable-spb-1.3, organization_ratings_translations_fix, profile_api_improvements, ratings_minor_fixes, remote_user_fix, send_email_to_admins, stable-spb-1.3, stable-spb-1.3-fixes, stable-spb-1.4, stable-spb-1.5, suggest_rejected_value, web_steps_improvements, xss_terminate_custom_options
Marking comments as ham atomically
ActionItem2306
|
| @@ -204,4 +204,9 @@ class Comment < ActiveRecord::Base |
| @@ -204,4 +204,9 @@ class Comment < ActiveRecord::Base |
|
204
| self.save! |
204
| self.save! |
|
205
| end |
205
| end |
|
206
| |
206
| |
|
| |
207
| + def ham! |
|
| |
208
| + self.spam = false |
|
| |
209
| + self.save! |
|
| |
210
| + end |
|
| |
211
| + |
|
207
| end |
212
| end |
|
| @@ -460,4 +460,11 @@ class CommentTest < ActiveSupport::TestCase |
| @@ -460,4 +460,11 @@ class CommentTest < ActiveSupport::TestCase |
|
460
| assert_equivalent [c3], Comment.spam |
460
| assert_equivalent [c3], Comment.spam |
|
461
| end |
461
| end |
|
462
| |
462
| |
|
| |
463
| + should 'be able to mark as ham atomically' do |
|
| |
464
| + c1 = fast_create(Comment, :name => 'foo', :email => 'foo@example.com', :spam => true) |
|
| |
465
| + c1.ham! |
|
| |
466
| + c1.reload |
|
| |
467
| + assert c1.ham? |
|
| |
468
| + end |
|
| |
469
| + |
|
463
| end |
470
| end |