fixes #2481: Include approvers on janitor trial report
This commit is contained in:
@@ -39,7 +39,7 @@ module Reports
|
|||||||
end
|
end
|
||||||
|
|
||||||
def janitors
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -11,6 +11,12 @@ module Danbooru
|
|||||||
attributes.each.with_index do |attribute, i|
|
attributes.each.with_index do |attribute, i|
|
||||||
bit_flag = 1 << 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
|
define_method(attribute) do
|
||||||
send(field) & bit_flag > 0
|
send(field) & bit_flag > 0
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user