From e70c2a3085ca944320343b0ccf63313be9e46a1a Mon Sep 17 00:00:00 2001 From: r888888888 Date: Fri, 17 Nov 2017 13:45:17 -0800 Subject: [PATCH] remove references to tag subscriptions --- .../tag_subscriptions_controller.rb | 31 --------------- app/helpers/application_helper.rb | 2 +- app/logical/anonymous_user.rb | 4 -- app/logical/user_deletion.rb | 5 --- app/models/user.rb | 1 - app/views/static/site_map.html.erb | 1 - .../_secondary_links.html.erb | 12 ------ app/views/tag_subscriptions/index.html.erb | 35 ----------------- app/views/users/_statistics.html.erb | 7 ---- config/danbooru_default_config.rb | 10 ----- config/locales/en.yml | 3 -- config/routes.rb | 5 --- db/seeds.rb | 12 ------ public/robots.txt | 1 - test/factories/tag_subscription.rb | 7 ---- .../tag_subscriptions_controller_test.rb | 39 ------------------- test/unit/tag_subscription_test.rb | 26 ------------- 17 files changed, 1 insertion(+), 200 deletions(-) delete mode 100644 app/controllers/tag_subscriptions_controller.rb delete mode 100644 app/views/tag_subscriptions/_secondary_links.html.erb delete mode 100644 app/views/tag_subscriptions/index.html.erb delete mode 100644 test/factories/tag_subscription.rb delete mode 100644 test/functional/tag_subscriptions_controller_test.rb delete mode 100644 test/unit/tag_subscription_test.rb diff --git a/app/controllers/tag_subscriptions_controller.rb b/app/controllers/tag_subscriptions_controller.rb deleted file mode 100644 index ae0d34869..000000000 --- a/app/controllers/tag_subscriptions_controller.rb +++ /dev/null @@ -1,31 +0,0 @@ -class TagSubscriptionsController < ApplicationController - before_filter :member_only, :only => [:destroy, :migrate] - respond_to :html, :xml, :json - - def index - @user = CurrentUser.user - @query = TagSubscription.order("name").search(params[:search]) - @tag_subscriptions = @query.paginate(params[:page], :limit => params[:limit]) - respond_with(@tag_subscriptions) - end - - def destroy - @tag_subscription = TagSubscription.find(params[:id]) - check_privilege(@tag_subscription) - @tag_subscription.destroy - respond_with(@tag_subscription) - end - - def migrate - @tag_subscription = TagSubscription.find(params[:id]) - check_privilege(@tag_subscription) - @tag_subscription.migrate_to_saved_searches - flash[:notice] = "Tag subscription will be migrated to a saved search. Please wait a few minutes for the search to refresh." - redirect_to tag_subscriptions_path - end - -private - def check_privilege(tag_subscription) - raise User::PrivilegeError unless tag_subscription.editable_by?(CurrentUser.user) - end -end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 23e1bc08f..b3775706e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -186,7 +186,7 @@ module ApplicationHelper protected def nav_link_match(controller, url) url =~ case controller - when "sessions", "users", "maintenance/user/login_reminders", "maintenance/user/password_resets", "admin/users", "tag_subscriptions" + when "sessions", "users", "maintenance/user/login_reminders", "maintenance/user/password_resets", "admin/users" /^\/(session|users)/ when "forum_posts" diff --git a/app/logical/anonymous_user.rb b/app/logical/anonymous_user.rb index e3ac6d5fe..4be3fe571 100644 --- a/app/logical/anonymous_user.rb +++ b/app/logical/anonymous_user.rb @@ -68,10 +68,6 @@ class AnonymousUser true end - def tag_subscriptions - [] - end - def favorite_tags nil end diff --git a/app/logical/user_deletion.rb b/app/logical/user_deletion.rb index da82664b3..70bb5a090 100644 --- a/app/logical/user_deletion.rb +++ b/app/logical/user_deletion.rb @@ -21,7 +21,6 @@ class UserDeletion validate clear_user_settings remove_favorites - clear_tag_subscriptions clear_saved_searches rename reset_password @@ -34,10 +33,6 @@ private ModAction.log("user ##{user.id} deleted") end - def clear_tag_subscriptions - TagSubscription.where(:creator_id => user.id).destroy_all - end - def clear_saved_searches SavedSearch.where(user_id: user.id).destroy_all end diff --git a/app/models/user.rb b/app/models/user.rb index 8c004cbdd..d48a77ec0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -97,7 +97,6 @@ class User < ApplicationRecord has_one :dmail_filter has_one :super_voter has_one :token_bucket - has_many :subscriptions, lambda {order("tag_subscriptions.name")}, :class_name => "TagSubscription", :foreign_key => "creator_id" has_many :note_versions, :foreign_key => "updater_id" has_many :dmails, lambda {order("dmails.id desc")}, :foreign_key => "owner_id" has_many :saved_searches diff --git a/app/views/static/site_map.html.erb b/app/views/static/site_map.html.erb index 58a377154..ac86fe60c 100644 --- a/app/views/static/site_map.html.erb +++ b/app/views/static/site_map.html.erb @@ -43,7 +43,6 @@
  • <%= link_to("Cheat sheet", wiki_pages_path(:title => "help:cheatsheet")) %>
  • <%= link_to("Aliases", tag_aliases_path) %>
  • <%= link_to("Implications", tag_implications_path) %>
  • -
  • <%= link_to("Subscriptions",tag_subscriptions_path) %>
  • <%= link_to("Listing", tags_path) %>