5
3
mirror of https://github.com/tildeverse/lobsters synced 2024-06-15 05:26:35 +00:00

allow mods to post quickly; useful for polls

This commit is contained in:
Peter Bhat Harkins 2018-02-20 14:39:59 -06:00
parent 05c613d356
commit 06d5736aa0

View File

@ -37,7 +37,7 @@ class CommentsController < ApplicationController
if params[:preview].blank? &&
(pc = Comment.where(:story_id => story.id, :user_id => @user.id,
:parent_comment_id => comment.parent_comment_id).first)
if (Time.now - pc.created_at) < 5.minutes
if (Time.now - pc.created_at) < 5.minutes && !@user.is_moderator?
comment.errors.add(:comment, "^You have already posted a comment " <<
"here recently.")