Fix incorrect post_upload_count, note_update_count, and unread_dmail_count columns on the users table.
12 lines
296 B
Ruby
Executable File
12 lines
296 B
Ruby
Executable File
require_relative "../../config/environment"
|
|
|
|
# Run a block of code in a transaction, and only commit it after confirmation.
|
|
def with_confirmation(&block)
|
|
ApplicationRecord.transaction do
|
|
yield
|
|
|
|
print "Commit? (yes/no): "
|
|
raise "abort" unless STDIN.readline.chomp == "yes"
|
|
end
|
|
end
|