rubocop: fix various style issues.

This commit is contained in:
evazion
2019-12-22 16:21:58 -06:00
parent 09f6a84660
commit 309821bf73
288 changed files with 912 additions and 962 deletions

10
script/fixes/013.rb Normal file → Executable file
View File

@@ -9,26 +9,26 @@ Comment.find_each do |comment|
puts "deleting comment #{comment.id}"
comment.destroy
end
end ; true
end; true
Ban.find_each do |ban|
puts "updating ban for user #{ban.user.id}"
ban.user.update_attribute(:is_banned, true)
end ; true
end; true
ArtistVersion.update_all "is_banned = false"
Artist.where("is_banned = true").find_each do |artist|
puts "updating artist #{artist.id}"
artist.versions.last.update_column(:is_banned, true)
end ; true
end; true
danbooru_conn = PGconn.connect(dbname: 'danbooru')
danbooru2_conn = PGconn.connect(dbname: "danbooru2")
danbooru_conn.exec("set statement_timeout = 0")
danbooru_conn.exec( "SELECT * FROM comments WHERE id < 29130" ) do |result|
danbooru_conn.exec("SELECT * FROM comments WHERE id < 29130") do |result|
result.each do |row|
# puts row["id"], row["created_at"], row["post_id"], row["user_id"], row["body"], row["ip_addr"], row["score"]
danbooru2_conn.exec "insert into comments (id, created_at, updated_at, post_id, creator_id, body, ip_addr, score, updater_id, updater_ip_addr) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)", [row["id"], row["created_at"], row["created_at"], row["post_id"], row["user_id"], row["body"], row["ip_addr"], row["score"], row["user_id"], row["ip_addr"]]
danbooru2_conn.exec "insert into comments (id, created_at, updated_at, post_id, creator_id, body, ip_addr, score, updater_id, updater_ip_addr) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)", [row["id"], row["created_at"], row["created_at"], row["post_id"], row["user_id"], row["body"], row["ip_addr"], row["score"], row["user_id"], row["ip_addr"]]
end
end