#1849: filter images for safebooru

This commit is contained in:
r888888888
2013-07-18 17:26:52 -07:00
parent 5ad3571d8b
commit 22bd07072a
6 changed files with 21 additions and 14 deletions

View File

@@ -1032,10 +1032,6 @@ class Post < ActiveRecord::Base
where("is_deleted = ?", true)
end
def visible(user)
Danbooru.config.can_user_see_post_conditions(user)
end
def commented_before(date)
where("last_commented_at < ?", date).order("last_commented_at DESC")
end
@@ -1151,6 +1147,13 @@ class Post < ActiveRecord::Base
extend SearchMethods
include PixivMethods
def visible?
return false if !Danbooru.config.can_user_see_post?(CurrentUser.user, self)
return false if CurrentUser.safe_mode? && rating != "s"
return false if is_banned? && !CurrentUser.is_gold?
return true
end
def reload(options = nil)
super
reset_tag_array_cache