fixes #316
This commit is contained in:
@@ -46,7 +46,8 @@ class Post < ActiveRecord::Base
|
||||
scope :tag_match, lambda {|query| PostQueryBuilder.new(query).build}
|
||||
scope :positive, where("score > 1")
|
||||
scope :negative, where("score < -1")
|
||||
search_methods :tag_match
|
||||
scope :updater_name_matches, lambda {|name| where("updater_id = (select _.id from users _ where lower(_.name) = ?)", name.downcase)}
|
||||
search_methods :tag_match, :updater_name_matches
|
||||
scope :after_id, Proc.new {|num|
|
||||
if num.present?
|
||||
where("id > ?", num.to_i).reorder("id asc")
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<div id="search">
|
||||
<%= simple_form_for(@search) do |f| %>
|
||||
<%= f.input :updater_name_eq, :label => "User", :required => false %>
|
||||
<%= f.input :updater_name_matches, :label => "User", :required => false %>
|
||||
<%= f.input :post_id_eq, :label => "Post", :required => false %>
|
||||
<%= f.button :submit, :value => "Search" %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user