diff --git a/app/models/post.rb b/app/models/post.rb index eca7f3de8..8c5746071 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -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 diff --git a/app/views/tag_aliases/new.html.erb b/app/views/tag_aliases/new.html.erb index 10fc7ecb3..9152c28f5 100644 --- a/app/views/tag_aliases/new.html.erb +++ b/app/views/tag_aliases/new.html.erb @@ -2,7 +2,8 @@

New Tag Alias

<%= 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 %> diff --git a/app/views/tag_implications/new.html.erb b/app/views/tag_implications/new.html.erb index 82ccc638f..0b32a1b63 100644 --- a/app/views/tag_implications/new.html.erb +++ b/app/views/tag_implications/new.html.erb @@ -2,6 +2,7 @@

New Tag Implication

<%= 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" %>