File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -5,19 +5,15 @@ class AnalyzeSpam < Struct.new(:spammable)
5
5
6
6
def perform
7
7
8
- ap ( spammable ) unless Rails . env . test?
9
-
10
8
spammable . symbolize_keys!
11
9
12
- thing_to_analyze = spammable [ :klass ] . constantize . find ( spammable [ :id ] )
13
-
14
- ap ( thing_to_analyze ) unless Rails . env . test?
10
+ thing_to_analyze = spammable [ :klass ] . classify . constantize . find ( spammable [ :id ] )
15
11
16
12
if thing_to_analyze . spam?
17
- puts ( "#{ spammable [ :klass ] } with id #{ spammable [ :id ] } was spam" ) unless Rails . env . test?
13
+ puts ( "#{ spammable [ :klass ] } with id #{ spammable [ :id ] } was spam" ) if ENV [ 'DEBUG' ]
18
14
thing_to_analyze . create_spam_report
19
15
else
20
- puts ( "#{ spammable [ :klass ] } with id #{ spammable [ :id ] } was NOT spam" ) unless Rails . env . test?
16
+ puts ( "#{ spammable [ :klass ] } with id #{ spammable [ :id ] } was NOT spam" ) if ENV [ 'DEBUG' ]
21
17
end
22
18
end
23
19
end
You can’t perform that action at this time.
0 commit comments