We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5101069 commit 8f953ceCopy full SHA for 8f953ce
app/models/comment.rb
@@ -107,10 +107,11 @@ def akismet_attributes
107
# While we do have tag comments, those are from logged-in users with special
108
# access granted by admins, so we never spam check them, unlike comments on
109
# works or admin posts.
110
- if ultimate_parent.is_a?(Work)
+ case ultimate_parent
111
+ when ->(p) { p.is_a?(Work) }
112
comment_type = "fanwork-comment"
113
comment_post_modified_gmt = ultimate_parent.revised_at.iso8601
- elsif ultimate_parent.is_a?(AdminPost)
114
+ when ->(p) { p.is_a?(AdminPost) }
115
comment_type = "comment"
116
comment_post_modified_gmt = ultimate_parent.created_at.iso8601
117
end
0 commit comments