add defaults for new aliases/implications

This commit is contained in:
albert
2013-02-24 11:29:06 -05:00
parent e6476587b4
commit bb3508a536
3 changed files with 7 additions and 1 deletions

View File

@@ -908,6 +908,10 @@ class Post < ActiveRecord::Base
where("id IN (SELECT pd.post_id FROM post_disapprovals pd WHERE pd.user_id = ?)", CurrentUser.id)
end
def raw_tag_match(tag)
where("posts.tag_index @@ to_tsquery('danbooru', E?)", tag)
end
def tag_match(query)
PostQueryBuilder.new(query).build
end

View File

@@ -2,7 +2,8 @@
<div id="a-new">
<h1>New Tag Alias</h1>
<%= simple_form_for(@tag_alias) do |f| %>
<%= f.input :antecedent_name, :label => "From" %>
<%= f.input :status, :value => "pending", :as => :hidden %>
<%= f.input :antecedent_name, :as => :string, :label => "From" %>
<%= f.input :consequent_name, :label => "To" %>
<%= f.input :forum_topic_id, :label => "Forum" %>
<%= f.button :submit %>

View File

@@ -2,6 +2,7 @@
<div id="a-new">
<h1>New Tag Implication</h1>
<%= simple_form_for(@tag_implication) do |f| %>
<%= f.input :status, :value => "pending", :as => :hidden %>
<%= f.input :antecedent_name, :label => "From" %>
<%= f.input :consequent_name, :label => "To" %>
<%= f.input :forum_topic_id, :label => "Forum" %>