diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 23791e577..684fde00b 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -66,12 +66,6 @@ class UsersController < ApplicationController render :nothing => true end - def restore_uploaded_tags - @user = User.find(params[:id]) - importer = UploadedTagsImporter.new(@user) - importer.import! - end - private def check_privilege(user) raise User::PrivilegeError unless (user.id == CurrentUser.id || CurrentUser.is_admin?) diff --git a/app/logical/uploaded_tags_importer.rb b/app/logical/uploaded_tags_importer.rb deleted file mode 100644 index c9b99e9bb..000000000 --- a/app/logical/uploaded_tags_importer.rb +++ /dev/null @@ -1,20 +0,0 @@ -class UploadedTagsImporter - attr_reader :user - - def initialize(user) - @user = user - end - - def import! - row = connection.exec("SELECT uploaded_tags FROM users WHERE id = #{user.id}").first - if row - user.update_attribute(:favorite_tags, row["uploaded_tags"]) - end - connection.close - rescue Exception - end - - def connection - @connection ||= PGconn.connect(:dbname => "danbooru", :host => "dbserver", :user => "albert") - end -end diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index a238b698c..f6681dd33 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -29,7 +29,7 @@