Skip to content

Commit

Permalink
Gremlins
Browse files Browse the repository at this point in the history
  • Loading branch information
j-f1 committed May 20, 2017
1 parent 14b42d5 commit 98864db
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def clear_flag
end

def users
@users = User.all.includes(roles).paginate(page: params[:page], per_page: 50)
@users = User.all.includes(:roles).paginate(page: params[:page], per_page: 50)
end

def ignored_users
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/user_site_settings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def enable_flagging
end

if current_user.update(flags_enabled: params[:enable])
render json: { status: "o\tk" }
render json: { status: 'ok' }
else
render json: { status: 'nope' }, status: 500
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def autoflag

def send_autoflag(user, dry_run, condition)
user_site_flag_count = user.flag_logs.where(site: site, success: true, is_dry_run: false).where(created_at: Date.today..Time.now).count
return 0 if user_site_flag_count >= user.user_site_settings.includes(sites).where(sites: { id: site.id }).minimum(:max_flags)
return 0 if user_site_flag_count >= user.user_site_settings.includes(:sites).where(sites: { id: site.id }).minimum(:max_flags)

last_log = FlagLog.auto.where(user: user).last
if last_log.try(:backoff).present? && (last_log.created_at + last_log.backoff.seconds > Time.now)
Expand Down

0 comments on commit 98864db

Please sign in to comment.