Skip to content

Commit 4888f52

Browse files
committed
resolve: Implement a spam filter on comments !553
1 parent 264e939 commit 4888f52

8 files changed

+54
-355
lines changed

Gemfile.lock

Lines changed: 0 additions & 277 deletions
Original file line numberDiff line numberDiff line change
@@ -746,283 +746,6 @@ GEM
746746
typhoeus (~> 0.6)
747747
treetop (1.4.15)
748748
polyglot
749-
polyglot
750-
polyglot
751-
polyglot
752-
polyglot
753-
polyglot
754-
polyglot
755-
polyglot
756-
polyglot
757-
polyglot
758-
polyglot
759-
polyglot
760-
polyglot
761-
polyglot
762-
polyglot
763-
polyglot
764-
polyglot
765-
polyglot (>= 0.3.1)
766-
polyglot (>= 0.3.1)
767-
polyglot (>= 0.3.1)
768-
polyglot (>= 0.3.1)
769-
polyglot (>= 0.3.1)
770-
polyglot (>= 0.3.1)
771-
polyglot (>= 0.3.1)
772-
polyglot (>= 0.3.1)
773-
polyglot (>= 0.3.1)
774-
polyglot (>= 0.3.1)
775-
polyglot (>= 0.3.1)
776-
polyglot (>= 0.3.1)
777-
polyglot (>= 0.3.1)
778-
polyglot (>= 0.3.1)
779-
polyglot (>= 0.3.1)
780-
polyglot (>= 0.3.1)
781-
polyglot (>= 0.3.1)
782-
polyglot (>= 0.3.1)
783-
polyglot (>= 0.3.1)
784-
polyglot (>= 0.3.1)
785-
polyglot (>= 0.3.1)
786-
polyglot (>= 0.3.1)
787-
polyglot (>= 0.3.1)
788-
polyglot (>= 0.3.1)
789-
polyglot (>= 0.3.1)
790-
polyglot (>= 0.3.1)
791-
polyglot (>= 0.3.1)
792-
polyglot (>= 0.3.1)
793-
polyglot (>= 0.3.1)
794-
polyglot (>= 0.3.1)
795-
polyglot (>= 0.3.1)
796-
polyglot (>= 0.3.1)
797-
polyglot (>= 0.3.1)
798-
polyglot (>= 0.3.1)
799-
polyglot (>= 0.3.1)
800-
polyglot (>= 0.3.1)
801-
polyglot (>= 0.3.1)
802-
polyglot (>= 0.3.1)
803-
polyglot (>= 0.3.1)
804-
polyglot (>= 0.3.1)
805-
polyglot (>= 0.3.1)
806-
polyglot (>= 0.3.1)
807-
polyglot (>= 0.3.1)
808-
polyglot (>= 0.3.1)
809-
polyglot (>= 0.3.1)
810-
polyglot (>= 0.3.1)
811-
polyglot (>= 0.3.1)
812-
polyglot (>= 0.3.1)
813-
polyglot (>= 0.3.1)
814-
polyglot (>= 0.3.1)
815-
polyglot (>= 0.3.1)
816-
polyglot (>= 0.3.1)
817-
polyglot (>= 0.3.1)
818-
polyglot (>= 0.3.1)
819-
polyglot (>= 0.3.1)
820-
polyglot (>= 0.3.1)
821-
polyglot (>= 0.3.1)
822-
polyglot (>= 0.3.1)
823-
polyglot (>= 0.3.1)
824-
polyglot (>= 0.3.1)
825-
polyglot (>= 0.3.1)
826-
polyglot (>= 0.3.1)
827-
polyglot (>= 0.3.1)
828-
polyglot (>= 0.3.1)
829-
polyglot (>= 0.3.1)
830-
polyglot (>= 0.3.1)
831-
polyglot (>= 0.3.1)
832-
polyglot (>= 0.3.1)
833-
polyglot (>= 0.3.1)
834-
polyglot (>= 0.3.1)
835-
polyglot (>= 0.3.1)
836-
polyglot (>= 0.3.1)
837-
polyglot (>= 0.3.1)
838-
polyglot (>= 0.3.1)
839-
polyglot (>= 0.3.1)
840-
polyglot (>= 0.3.1)
841-
polyglot (>= 0.3.1)
842-
polyglot (>= 0.3.1)
843-
polyglot (>= 0.3.1)
844-
polyglot (>= 0.3.1)
845-
polyglot (>= 0.3.1)
846-
polyglot (>= 0.3.1)
847-
polyglot (>= 0.3.1)
848-
polyglot (>= 0.3.1)
849-
polyglot (>= 0.3.1)
850-
polyglot (>= 0.3.1)
851-
polyglot (>= 0.3.1)
852-
polyglot (>= 0.3.1)
853-
polyglot (>= 0.3.1)
854-
polyglot (>= 0.3.1)
855-
polyglot (>= 0.3.1)
856-
polyglot (>= 0.3.1)
857-
polyglot (>= 0.3.1)
858-
polyglot (>= 0.3.1)
859-
polyglot (>= 0.3.1)
860-
polyglot (>= 0.3.1)
861-
polyglot (>= 0.3.1)
862-
polyglot (>= 0.3.1)
863-
polyglot (>= 0.3.1)
864-
polyglot (>= 0.3.1)
865-
polyglot (>= 0.3.1)
866-
polyglot (>= 0.3.1)
867-
polyglot (>= 0.3.1)
868-
polyglot (>= 0.3.1)
869-
polyglot (>= 0.3.1)
870-
polyglot (>= 0.3.1)
871-
polyglot (>= 0.3.1)
872-
polyglot (>= 0.3.1)
873-
polyglot (>= 0.3.1)
874-
polyglot (>= 0.3.1)
875-
polyglot (>= 0.3.1)
876-
polyglot (>= 0.3.1)
877-
polyglot (>= 0.3.1)
878-
polyglot (>= 0.3.1)
879-
polyglot (>= 0.3.1)
880-
polyglot (>= 0.3.1)
881-
polyglot (>= 0.3.1)
882-
polyglot (>= 0.3.1)
883-
polyglot (>= 0.3.1)
884-
polyglot (>= 0.3.1)
885-
polyglot (>= 0.3.1)
886-
polyglot (>= 0.3.1)
887-
polyglot (>= 0.3.1)
888-
polyglot (>= 0.3.1)
889-
polyglot (>= 0.3.1)
890-
polyglot (>= 0.3.1)
891-
polyglot (>= 0.3.1)
892-
polyglot (>= 0.3.1)
893-
polyglot (>= 0.3.1)
894-
polyglot (>= 0.3.1)
895-
polyglot (>= 0.3.1)
896-
polyglot (>= 0.3.1)
897-
polyglot (>= 0.3.1)
898-
polyglot (>= 0.3.1)
899-
polyglot (>= 0.3.1)
900-
polyglot (>= 0.3.1)
901-
polyglot (>= 0.3.1)
902-
polyglot (>= 0.3.1)
903-
polyglot (>= 0.3.1)
904-
polyglot (>= 0.3.1)
905-
polyglot (>= 0.3.1)
906-
polyglot (>= 0.3.1)
907-
polyglot (>= 0.3.1)
908-
polyglot (>= 0.3.1)
909-
polyglot (>= 0.3.1)
910-
polyglot (>= 0.3.1)
911-
polyglot (>= 0.3.1)
912-
polyglot (>= 0.3.1)
913-
polyglot (>= 0.3.1)
914-
polyglot (>= 0.3.1)
915-
polyglot (>= 0.3.1)
916-
polyglot (>= 0.3.1)
917-
polyglot (>= 0.3.1)
918-
polyglot (>= 0.3.1)
919-
polyglot (>= 0.3.1)
920-
polyglot (>= 0.3.1)
921-
polyglot (>= 0.3.1)
922-
polyglot (>= 0.3.1)
923-
polyglot (>= 0.3.1)
924-
polyglot (>= 0.3.1)
925-
polyglot (>= 0.3.1)
926-
polyglot (>= 0.3.1)
927-
polyglot (>= 0.3.1)
928-
polyglot (>= 0.3.1)
929-
polyglot (>= 0.3.1)
930-
polyglot (>= 0.3.1)
931-
polyglot (>= 0.3.1)
932-
polyglot (>= 0.3.1)
933-
polyglot (>= 0.3.1)
934-
polyglot (>= 0.3.1)
935-
polyglot (>= 0.3.1)
936-
polyglot (>= 0.3.1)
937-
polyglot (>= 0.3.1)
938-
polyglot (>= 0.3.1)
939-
polyglot (>= 0.3.1)
940-
polyglot (>= 0.3.1)
941-
polyglot (>= 0.3.1)
942-
polyglot (>= 0.3.1)
943-
polyglot (>= 0.3.1)
944-
polyglot (>= 0.3.1)
945-
polyglot (>= 0.3.1)
946-
polyglot (>= 0.3.1)
947-
polyglot (>= 0.3.1)
948-
polyglot (>= 0.3.1)
949-
polyglot (>= 0.3.1)
950-
polyglot (>= 0.3.1)
951-
polyglot (>= 0.3.1)
952-
polyglot (>= 0.3.1)
953-
polyglot (>= 0.3.1)
954-
polyglot (>= 0.3.1)
955-
polyglot (>= 0.3.1)
956-
polyglot (>= 0.3.1)
957-
polyglot (>= 0.3.1)
958-
polyglot (>= 0.3.1)
959-
polyglot (>= 0.3.1)
960-
polyglot (>= 0.3.1)
961-
polyglot (>= 0.3.1)
962-
polyglot (>= 0.3.1)
963-
polyglot (>= 0.3.1)
964-
polyglot (>= 0.3.1)
965-
polyglot (>= 0.3.1)
966-
polyglot (>= 0.3.1)
967-
polyglot (>= 0.3.1)
968-
polyglot (>= 0.3.1)
969-
polyglot (>= 0.3.1)
970-
polyglot (>= 0.3.1)
971-
polyglot (>= 0.3.1)
972-
polyglot (>= 0.3.1)
973-
polyglot (>= 0.3.1)
974-
polyglot (>= 0.3.1)
975-
polyglot (>= 0.3.1)
976-
polyglot (>= 0.3.1)
977-
polyglot (>= 0.3.1)
978-
polyglot (>= 0.3.1)
979-
polyglot (>= 0.3.1)
980-
polyglot (>= 0.3.1)
981-
polyglot (>= 0.3.1)
982-
polyglot (>= 0.3.1)
983-
polyglot (>= 0.3.1)
984-
polyglot (>= 0.3.1)
985-
polyglot (>= 0.3.1)
986-
polyglot (>= 0.3.1)
987-
polyglot (>= 0.3.1)
988-
polyglot (>= 0.3.1)
989-
polyglot (>= 0.3.1)
990-
polyglot (>= 0.3.1)
991-
polyglot (>= 0.3.1)
992-
polyglot (>= 0.3.1)
993-
polyglot (>= 0.3.1)
994-
polyglot (>= 0.3.1)
995-
polyglot (>= 0.3.1)
996-
polyglot (>= 0.3.1)
997-
polyglot (>= 0.3.1)
998-
polyglot (>= 0.3.1)
999-
polyglot (>= 0.3.1)
1000-
polyglot (>= 0.3.1)
1001-
polyglot (>= 0.3.1)
1002-
polyglot (>= 0.3.1)
1003-
polyglot (>= 0.3.1)
1004-
polyglot (>= 0.3.1)
1005-
polyglot (>= 0.3.1)
1006-
polyglot (>= 0.3.1)
1007-
polyglot (>= 0.3.1)
1008-
polyglot (>= 0.3.1)
1009-
polyglot (>= 0.3.1)
1010-
polyglot (>= 0.3.1)
1011-
polyglot (>= 0.3.1)
1012-
polyglot (>= 0.3.1)
1013-
polyglot (>= 0.3.1)
1014-
polyglot (>= 0.3.1)
1015-
polyglot (>= 0.3.1)
1016-
polyglot (>= 0.3.1)
1017-
polyglot (>= 0.3.1)
1018-
polyglot (>= 0.3.1)
1019-
polyglot (>= 0.3.1)
1020-
polyglot (>= 0.3.1)
1021-
polyglot (>= 0.3.1)
1022-
polyglot (>= 0.3.1)
1023-
polyglot (>= 0.3.1)
1024-
polyglot (>= 0.3.1)
1025-
polyglot (>= 0.3.1)
1026749
polyglot (>= 0.3.1)
1027750
turnip (1.2.4)
1028751
gherkin (>= 2.5)

app/models/comment.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Comment < ActiveRecord::Base
2323
has_many :likes, as: :likable, dependent: :destroy
2424
has_one :spam_report, as: :spammable
2525
after_create :generate_event
26-
after_create :analyze_spam
26+
after_save :analyze_spam
2727
after_save :commented_callback
2828

2929
default_scope order: 'likes_cache DESC, created_at ASC'

app/models/protip.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class Protip < ActiveRecord::Base
108108
after_save :index_search
109109
after_destroy :index_search_after_destroy
110110
after_create :update_network
111-
after_create :analyze_spam
111+
after_save :analyze_spam
112112
# End of test failing lines
113113

114114
attr_accessor :upvotes_value

app/views/home/index.html.haml

Lines changed: 0 additions & 37 deletions
This file was deleted.

app/views/home/index.html.slim

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
= content_for :footer_menu do
2+
li=link_to 'Protips', by_tags_protips_path
3+
4+
section.users-top
5+
.inside
6+
= link_to 'Sign in', signin_path, class: 'sign-in'
7+
= link_to nil , root_path, class: 'new-logo'
8+
h1.mainline A community for developers to unlock &amp; share new skills.
9+
.sign-up-panel
10+
= render 'sessions/join_buttons'
11+
section.home-section
12+
.inside.cf
13+
.text
14+
h2 Share protips, learn from the community
15+
p Learn from the experts about the latest languages, tools &amp; technologies or share your own pro tip and get feedback from thousands of developers. Share code snippets, tutorials or thought pieces with your peers.
16+
.image
17+
= image_tag('protip.jpg')
18+
section.home-section.badge-section
19+
.inside.cf
20+
.text
21+
h2 Unlock &amp; earn badges for your coding achievements
22+
p Earn unique Coderwall badges to display on your user profile. Based on your github repositories, earn badges for all major language types, represent your skills, level-up.
23+
.image
24+
= image_tag('badges2.jpg')
25+
section.home-section.team-section
26+
.inside.cf
27+
.text
28+
h2 Represent your team, curate its culture
29+
p Discover over 6,000 brilliant engineering teams, how they're solving interesting challenges, and even find your next dream job. Curate your team's page by adding unique content, illustrating it's culture.
30+
.image
31+
= image_tag('team.jpg')
32+
section.second-signup
33+
.inside.cf
34+
h2.subline Start building your coderwall:
35+
= render 'sessions/join_buttons'

app/views/sessions/_join_buttons.html.haml

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)