fixes #2386, fix tests
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user