forked from e621ng/e621ng
fixes #2481: Include approvers on janitor trial report
This commit is contained in:
parent
9dfaad7c98
commit
554a616963
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user