Merge pull request #4271 from BrokenEagle/embedded-notes-search
Add search for embedded notes status
This commit is contained in:
@@ -32,7 +32,7 @@ module Danbooru
|
||||
bits = attributes.length
|
||||
bit_index = bits - attributes.index(flag.to_s) - 1
|
||||
|
||||
where(sanitize_sql(["get_bit(bit_prefs::bit(?), ?) = ?", bits, bit_index, value]))
|
||||
where(sanitize_sql(["get_bit(#{field}::bit(?), ?) = ?", bits, bit_index, value]))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -440,6 +440,12 @@ class PostQueryBuilder
|
||||
relation = relation.where("posts.is_status_locked = FALSE")
|
||||
end
|
||||
|
||||
if q[:embedded] == "true"
|
||||
relation = relation.bit_flags_match(:has_embedded_notes, true)
|
||||
elsif q[:embedded] == "false"
|
||||
relation = relation.bit_flags_match(:has_embedded_notes, false)
|
||||
end
|
||||
|
||||
relation = add_tag_string_search_relation(q[:tags], relation)
|
||||
|
||||
if q[:ordpool].present?
|
||||
|
||||
Reference in New Issue
Block a user