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) %>
diff --git a/app/views/tag_subscriptions/_secondary_links.html.erb b/app/views/tag_subscriptions/_secondary_links.html.erb
deleted file mode 100644
index 4a42f0f56..000000000
--- a/app/views/tag_subscriptions/_secondary_links.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-<% content_for(:secondary_links) do %>
-
-<% end %>
diff --git a/app/views/tag_subscriptions/index.html.erb b/app/views/tag_subscriptions/index.html.erb
deleted file mode 100644
index d1f05b37f..000000000
--- a/app/views/tag_subscriptions/index.html.erb
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
Tag Subscriptions
-
-
The tag subscription feature is being deprecated. You can move your current tag subscriptions to saved searches by clicking the "migrate" link below.
-
-
-
-
- | Name |
- Tag Query |
- |
-
-
-
- <% @tag_subscriptions.each do |tag_subscription| %>
-
- | <%= tag_subscription.pretty_name %> |
- <%= tag_subscription.pretty_tag_query %> |
-
- <%= link_to "delete", tag_subscription_path(tag_subscription), :method => :delete, :data => {:confirm => "Are you sure you want to delete this subscription?"} %>
- | <%= link_to "migrate", migrate_tag_subscription_path(tag_subscription), :method => :post %>
- |
-
- <% end %>
-
-
-
-
-
-<%= render "secondary_links" %>
-
-<% content_for(:page_title) do %>
- Tag Subscriptions - <%= Danbooru.config.app_name %>
-<% end %>
diff --git a/app/views/users/_statistics.html.erb b/app/views/users/_statistics.html.erb
index d70c0d181..0429d1840 100644
--- a/app/views/users/_statistics.html.erb
+++ b/app/views/users/_statistics.html.erb
@@ -161,13 +161,6 @@
<% end %>
-
- | Subscriptions |
-
- This feature has been disabled. <%= link_to "Migrate your tag subscriptions to saved searches", tag_subscriptions_path %>.
- |
-
-
| API Key |
diff --git a/config/danbooru_default_config.rb b/config/danbooru_default_config.rb
index b2e93f33f..e6d322395 100644
--- a/config/danbooru_default_config.rb
+++ b/config/danbooru_default_config.rb
@@ -169,21 +169,11 @@ module Danbooru
end
end
- # Max number of posts to cache
- def tag_subscription_post_limit
- 200
- end
-
# After this many pages, the paginator will switch to sequential mode.
def max_numbered_pages
1_000
end
- # Max number of tag subscriptions per user
- def max_tag_subscriptions
- 5
- end
-
# Maximum size of an upload.
def max_file_size
35.megabytes
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 305dc293e..fe1fe27fe 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -27,9 +27,6 @@ en:
comment_vote:
comment: "You"
user_id: "You"
- tag_subscription:
- creator: "You"
- creator_id: "You"
upload:
uploader: "You"
uploader_id: "You"
diff --git a/config/routes.rb b/config/routes.rb
index de7143f76..1f6f24d61 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -276,11 +276,6 @@ Rails.application.routes.draw do
end
end
resource :tag_implication_request, :only => [:new, :create]
- resources :tag_subscriptions, :only => [:index, :destroy, :migrate] do
- member do
- post :migrate
- end
- end
resources :uploads do
collection do
get :batch
diff --git a/db/seeds.rb b/db/seeds.rb
index 38961c084..cab96a710 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -216,15 +216,3 @@ if ForumTopic.count == 0
end
end
end
-
-if TagSubscription.count == 0
- puts "Creating tag subscriptions"
- TagSubscription.create(:name => "0", :tag_query => Tag.order("random()").first.name)
- 1.upto(50) do |i|
- CurrentUser.user = User.order("random()").first
- TagSubscription.create(:name => i.to_s, :tag_query => Tag.order("random()").first.name)
- end
-else
- puts "Skipping tag subscriptions"
-end
-
diff --git a/public/robots.txt b/public/robots.txt
index 15efe95a4..017f78e6f 100644
--- a/public/robots.txt
+++ b/public/robots.txt
@@ -45,7 +45,6 @@ Disallow: /tag_aliases
Disallow: /tag_corrections
Disallow: /tag_implication_requests
Disallow: /tag_implications
-Disallow: /tag_subscriptions
Disallow: /tags
Disallow: /uploads
Disallow: /user_feedback
diff --git a/test/factories/tag_subscription.rb b/test/factories/tag_subscription.rb
deleted file mode 100644
index 4b7e9e1ae..000000000
--- a/test/factories/tag_subscription.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-FactoryGirl.define do
- factory(:tag_subscription) do
- name {FFaker::Lorem.words.join(" ")}
- is_public true
- tag_query "aaa"
- end
-end
diff --git a/test/functional/tag_subscriptions_controller_test.rb b/test/functional/tag_subscriptions_controller_test.rb
deleted file mode 100644
index 7935de110..000000000
--- a/test/functional/tag_subscriptions_controller_test.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-require 'test_helper'
-
-class TagSubscriptionsControllerTest < ActionController::TestCase
- context "The tag subscriptions controller" do
- setup do
- @user = FactoryGirl.create(:user)
- CurrentUser.user = @user
- CurrentUser.ip_addr = "127.0.0.1"
- end
-
- teardown do
- CurrentUser.user = nil
- CurrentUser.ip_addr = nil
- end
-
- context "index action" do
- setup do
- @tag_subscription = FactoryGirl.create(:tag_subscription, :name => "aaa")
- end
-
- should "list all visible tag subscriptions" do
- get :index
- assert_response :success
- end
- end
-
- context "destroy action" do
- setup do
- @tag_subscription = FactoryGirl.create(:tag_subscription)
- end
-
- should "destroy the posts" do
- assert_difference("TagSubscription.count", -1) do
- post :destroy, {:id => @tag_subscription.id}, {:user_id => @user.id}
- end
- end
- end
- end
-end
diff --git a/test/unit/tag_subscription_test.rb b/test/unit/tag_subscription_test.rb
deleted file mode 100644
index d5ba531f2..000000000
--- a/test/unit/tag_subscription_test.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require 'test_helper'
-
-class TagSubscriptionTest < ActiveSupport::TestCase
- setup do
- user = FactoryGirl.create(:user)
- CurrentUser.user = user
- CurrentUser.ip_addr = "127.0.0.1"
- end
-
- teardown do
- CurrentUser.user = nil
- CurrentUser.ip_addr = nil
- end
-
- context "A tag subscription" do
- should "migrate to saved searches" do
- sub = FactoryGirl.create(:tag_subscription, tag_query: "foo bar\r\nbar\nbaz", :name => "Artist 1")
- sub.migrate_to_saved_searches
-
- assert_equal(1, CurrentUser.user.subscriptions.size)
- assert_equal(3, CurrentUser.user.saved_searches.size)
- assert_equal(["foo bar", "bar", "baz"], CurrentUser.user.saved_searches.pluck(:query))
- assert_equal([%w[artist_1]]*3, CurrentUser.user.saved_searches.pluck(:labels))
- end
- end
-end
|