fixes #2386, fix tests

This commit is contained in:
r888888888
2015-05-21 11:57:08 -07:00
parent ff83e0a7a8
commit 45ffe0b68e
3 changed files with 37 additions and 12 deletions

View File

@@ -20,6 +20,7 @@ class Post < ActiveRecord::Base
before_save :update_tag_post_counts
before_save :set_tag_counts
before_save :set_pool_category_pseudo_tags
before_create :autoban
before_validation :strip_source
before_validation :initialize_uploader, :on => :create
before_validation :parse_pixiv_id
@@ -290,6 +291,12 @@ class Post < ActiveRecord::Base
def disapproved_by?(user)
PostDisapproval.where(:user_id => user.id, :post_id => id).exists?
end
def autoban
if has_tag?("banned_artist")
self.is_banned = true
end
end
end
module PresenterMethods
@@ -1558,6 +1565,7 @@ class Post < ActiveRecord::Base
def reload(options = nil)
super
reset_tag_array_cache
@pools = nil
@tag_categories = nil
@typed_tags = nil
self