forked from e621ng/e621ng
Fix comment vote search filtering
This commit is contained in:
parent
244356d723
commit
84ba528cff
@ -53,7 +53,7 @@ class CommentVote < ApplicationRecord
|
||||
end
|
||||
|
||||
module SearchMethods
|
||||
def self.search(params)
|
||||
def search(params)
|
||||
q = super
|
||||
|
||||
if params[:comment_id].present?
|
||||
@ -65,6 +65,10 @@ class CommentVote < ApplicationRecord
|
||||
q = q.where('user_id = ?', user_id) if user_id
|
||||
end
|
||||
|
||||
if params[:user_id].present?
|
||||
q = q.where('user_id = ?', params[:user_id].to_i)
|
||||
end
|
||||
|
||||
q.order(id: :desc)
|
||||
|
||||
q
|
||||
|
@ -43,9 +43,9 @@
|
||||
<% elsif vote.score == nil %>Unrecorded
|
||||
<% else %><span class='redtext'>Down</span>
|
||||
<% end %></td>
|
||||
<td title="Created at <%= vote.created_at.strftime("%c") %>"><%= time_ago_in_words(vote.created_at) %>ago
|
||||
<td title="Created at <%= vote.created_at.strftime("%c") %>"><%= time_ago_in_words(vote.created_at) %> ago
|
||||
</td>
|
||||
<td title="Updated at <%= vote.updated_at.strftime("%c") %>"><%= time_ago_in_words(vote.updated_at) %>ago
|
||||
<td title="Updated at <%= vote.updated_at.strftime("%c") %>"><%= time_ago_in_words(vote.updated_at) %> ago
|
||||
</td>
|
||||
<td><%= link_to_ip vote.user_ip_addr %></td>
|
||||
</tr>
|
||||
|
Loading…
Reference in New Issue
Block a user