deprecate tag subscriptions with warnings
This commit is contained in:
@@ -8,7 +8,6 @@ class DailyMaintenance
|
||||
Delayed::Job.delete_all(['created_at < ?', 7.days.ago])
|
||||
PostVote.prune!
|
||||
CommentVote.prune!
|
||||
#TagSubscription.process_all
|
||||
ApiCacheGenerator.new.generate_tag_cache
|
||||
PostDisapproval.prune!
|
||||
ForumSubscription.process_all!
|
||||
|
||||
@@ -80,27 +80,6 @@ class PostQueryBuilder
|
||||
relation
|
||||
end
|
||||
|
||||
def add_tag_subscription_relation(subscriptions, relation)
|
||||
subscriptions.each do |subscription|
|
||||
if subscription =~ /^(.+?):(.+)$/
|
||||
user_name = $1
|
||||
subscription_name = $2
|
||||
user = User.find_by_name(user_name)
|
||||
return relation if user.nil?
|
||||
post_ids = TagSubscription.find_post_ids(user.id, subscription_name)
|
||||
else
|
||||
user = User.find_by_name(subscription)
|
||||
return relation if user.nil?
|
||||
post_ids = TagSubscription.find_post_ids(user.id)
|
||||
end
|
||||
|
||||
post_ids = [0] if post_ids.empty?
|
||||
relation = relation.where(["posts.id IN (?)", post_ids])
|
||||
end
|
||||
|
||||
relation
|
||||
end
|
||||
|
||||
def add_saved_search_relation(saved_searches, relation)
|
||||
if SavedSearch.enabled?
|
||||
saved_searches.each do |saved_search|
|
||||
@@ -228,11 +207,6 @@ class PostQueryBuilder
|
||||
relation = relation.where("posts.pool_string != ''")
|
||||
end
|
||||
|
||||
if q[:subscriptions]
|
||||
relation = add_tag_subscription_relation(q[:subscriptions], relation)
|
||||
has_constraints!
|
||||
end
|
||||
|
||||
if q[:saved_searches]
|
||||
relation = add_saved_search_relation(q[:saved_searches], relation)
|
||||
has_constraints!
|
||||
|
||||
@@ -166,22 +166,10 @@ module PostSets
|
||||
[page.to_i, 1].max
|
||||
end
|
||||
|
||||
def is_tag_subscription?
|
||||
tag_subscription.present?
|
||||
end
|
||||
|
||||
def is_saved_search?
|
||||
tag_string =~ /search:/
|
||||
end
|
||||
|
||||
def tag_subscription
|
||||
@tag_subscription ||= tag_array.select {|x| x =~ /^sub:/}.map {|x| x.sub(/^sub:/, "")}.first
|
||||
end
|
||||
|
||||
def tag_subscription_tags
|
||||
@tag_subscription_tags ||= TagSubscription.find_tags(tag_subscription)
|
||||
end
|
||||
|
||||
def presenter
|
||||
@presenter ||= ::PostSetPresenters::Post.new(self)
|
||||
end
|
||||
|
||||
@@ -22,6 +22,7 @@ class UserDeletion
|
||||
clear_user_settings
|
||||
remove_favorites
|
||||
clear_tag_subscriptions
|
||||
clear_saved_searches
|
||||
rename
|
||||
reset_password
|
||||
create_mod_action
|
||||
@@ -37,6 +38,10 @@ private
|
||||
TagSubscription.where(:creator_id => user.id).destroy_all
|
||||
end
|
||||
|
||||
def clear_saved_searches
|
||||
SavedSearch.where(user_id: user.id).destroy_all
|
||||
end
|
||||
|
||||
def clear_user_settings
|
||||
user.email = nil
|
||||
user.last_logged_in_at = nil
|
||||
|
||||
Reference in New Issue
Block a user