expose recommended posts to everyone
This commit is contained in:
@@ -18,7 +18,7 @@ class Post < ApplicationRecord
|
||||
before_validation :parse_pixiv_id
|
||||
before_validation :blank_out_nonexistent_parents
|
||||
before_validation :remove_parent_loops
|
||||
validates_uniqueness_of :md5, :on => :create
|
||||
validates_uniqueness_of :md5, :on => :create, message: ->(obj, data) { "duplicate: #{Post.find_by_md5(obj.md5).id}"}
|
||||
validates_inclusion_of :rating, in: %w(s q e), message: "rating must be s, q, or e"
|
||||
validate :tag_names_are_valid
|
||||
validate :added_tags_are_valid
|
||||
|
||||
@@ -10,7 +10,7 @@ module RecommenderService
|
||||
def available_for_post?(post)
|
||||
return true if Rails.env.development?
|
||||
|
||||
enabled? && CurrentUser.enable_recommended_posts? && post.created_at > Date.civil(2017, 1, 1) && post.fav_count >= SCORE_THRESHOLD
|
||||
enabled? && post.created_at > Date.civil(2017, 1, 1) && post.fav_count >= SCORE_THRESHOLD
|
||||
end
|
||||
|
||||
def available_for_user?
|
||||
|
||||
Reference in New Issue
Block a user