Add noter:<any|none> metatags.
This commit is contained in:
@@ -245,7 +245,13 @@ class PostQueryBuilder
|
|||||||
|
|
||||||
if q[:noter_ids]
|
if q[:noter_ids]
|
||||||
q[:noter_ids].each do |noter_id|
|
q[:noter_ids].each do |noter_id|
|
||||||
relation = relation.where("posts.id IN (?)", Note.unscoped.where("creator_id = ?", noter_id).select("post_id").uniq)
|
if noter_id == "any"
|
||||||
|
relation = relation.where("posts.last_noted_at is not null")
|
||||||
|
elsif noter_id == "none"
|
||||||
|
relation = relation.where("posts.last_noted_at is null")
|
||||||
|
else
|
||||||
|
relation = relation.where("posts.id": Note.unscoped.where(creator_id: noter_id).select("post_id").distinct)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
has_constraints!
|
has_constraints!
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -448,8 +448,15 @@ class Tag < ActiveRecord::Base
|
|||||||
|
|
||||||
when "noter"
|
when "noter"
|
||||||
q[:noter_ids] ||= []
|
q[:noter_ids] ||= []
|
||||||
user_id = User.name_to_id($2)
|
|
||||||
q[:noter_ids] << user_id unless user_id.blank?
|
if $2 == "none"
|
||||||
|
q[:noter_ids] << "none"
|
||||||
|
elsif $2 == "any"
|
||||||
|
q[:noter_ids] << "any"
|
||||||
|
else
|
||||||
|
user_id = User.name_to_id($2)
|
||||||
|
q[:noter_ids] << user_id unless user_id.blank?
|
||||||
|
end
|
||||||
|
|
||||||
when "noteupdater"
|
when "noteupdater"
|
||||||
q[:note_updater_ids] ||= []
|
q[:note_updater_ids] ||= []
|
||||||
|
|||||||
Reference in New Issue
Block a user