This commit is contained in:
albert
2013-04-09 18:05:23 -04:00
parent 0c16403c29
commit 56f1e19f67
5 changed files with 1 additions and 29 deletions

View File

@@ -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