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