From 00c1c4691d0ddcb7b04b3976868779c809f6083b Mon Sep 17 00:00:00 2001 From: nirnanaaa Date: Wed, 29 May 2013 19:54:23 +0200 Subject: [PATCH] there is a scope in User model but not used in staff_constraint --- lib/staff_constraint.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/staff_constraint.rb b/lib/staff_constraint.rb index 95ec8287b2d..8892e22dd02 100644 --- a/lib/staff_constraint.rb +++ b/lib/staff_constraint.rb @@ -4,7 +4,7 @@ class StaffConstraint def matches?(request) return false unless request.session[:current_user_id].present? - User.where("admin = 't' or moderator = 't'").where(id: request.session[:current_user_id].to_i).exists? + User.staff.where(id: request.session[:current_user_id].to_i).exists? end end