fixes #2481: Include approvers on janitor trial report

This commit is contained in:
r888888888 2015-08-11 15:47:39 -07:00
parent 9dfaad7c98
commit 554a616963
2 changed files with 7 additions and 1 deletions

View File

@ -39,7 +39,7 @@ module Reports
end
def janitors
User.where("level >= ?", User::Levels::JANITOR).to_a.map {|x| Janitor.new(x)}
User.where("bit_prefs & ? > 0", User.flag_value_for("can_approve_posts")).to_a.map {|x| Janitor.new(x)}
end
end
end

View File

@ -11,6 +11,12 @@ module Danbooru
attributes.each.with_index do |attribute, i|
bit_flag = 1 << i
define_singleton_method("flag_value_for") do |key|
index = attributes.index(key)
raise IndexError if index.nil?
1 << index
end
define_method(attribute) do
send(field) & bit_flag > 0
end