fix pool metatags, fix artist search
This commit is contained in:
@@ -33,7 +33,6 @@ class BansController < ApplicationController
|
||||
if @ban.update_attributes(params[:ban])
|
||||
redirect_to ban_path(@ban), :notice => "Ban updated"
|
||||
else
|
||||
puts @ban.errors.full_messages
|
||||
render :action => "edit"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -84,8 +84,6 @@ class Comment < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def update_last_commented_at
|
||||
puts Comment.where("post_id = ?", post_id).count
|
||||
puts !do_not_bump_post?
|
||||
if Comment.where("post_id = ?", post_id).count == 0
|
||||
Post.update_all("last_commented_at = NULL", ["id = ?", post_id])
|
||||
elsif Comment.where("post_id = ?", post_id).count <= Danbooru.config.comment_threshold && !do_not_bump_post?
|
||||
|
||||
@@ -8,6 +8,7 @@ class Post < ActiveRecord::Base
|
||||
after_destroy :delete_remote_files
|
||||
after_save :create_version
|
||||
after_save :update_parent_on_save
|
||||
after_save :apply_metatags, :on => :create
|
||||
before_save :merge_old_tags
|
||||
before_save :normalize_tags
|
||||
before_save :create_tags
|
||||
@@ -380,13 +381,15 @@ class Post < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def filter_metatags(tags)
|
||||
metatags, tags = tags.partition {|x| x =~ /\A(?:-pool|pool|rating|fav|parent):/}
|
||||
apply_metatags(metatags)
|
||||
@metatags, tags = tags.partition {|x| x =~ /\A(?:-pool|pool|rating|fav|parent):/}
|
||||
apply_metatags
|
||||
return tags
|
||||
end
|
||||
|
||||
def apply_metatags(tags)
|
||||
tags.each do |tag|
|
||||
def apply_metatags
|
||||
return unless @metatags.is_a?(Array)
|
||||
|
||||
@metatags.each do |tag|
|
||||
case tag
|
||||
when /^parent:none$/, /^parent:0$/
|
||||
self.parent_id = nil
|
||||
|
||||
@@ -2,7 +2,7 @@ module Danbooru
|
||||
module Extensions
|
||||
module String
|
||||
def to_escaped_for_sql_like
|
||||
return self.gsub(/\\/, '\0\0').gsub(/(%|_)/, '\\\\\\1').gsub(/_/, '\\_').gsub(/\*/, '%')
|
||||
return self.gsub(/\\/, '\0\0').gsub(/(%|_)/, "\\\\\\1").gsub(/\*/, '%')
|
||||
end
|
||||
|
||||
def to_escaped_js
|
||||
|
||||
Reference in New Issue
Block a user