emails: add fix script to delete duplicate email addresses.
In the past it was possible for users to create multiple accounts with the same email address. We had about 9000 such accounts. This removes the email address from these accounts. When multiple accounts have the same email address, the account that visited the site last gets to keep the address.
This commit is contained in:
@@ -149,6 +149,7 @@ class User < ApplicationRecord
|
||||
scope :deleted, -> { where("name ~ 'user_[0-9]+~*'") }
|
||||
scope :undeleted, -> { where("name !~ 'user_[0-9]+~*'") }
|
||||
scope :admins, -> { where(level: Levels::ADMIN) }
|
||||
scope :banned, -> { bit_prefs_match(:is_banned, true) }
|
||||
|
||||
scope :has_blacklisted_tag, ->(name) { where_regex(:blacklisted_tags, "(^| )[~-]?#{Regexp.escape(name)}( |$)", flags: "ni") }
|
||||
scope :has_private_favorites, -> { bit_prefs_match(:enable_private_favorites, true) }
|
||||
|
||||
Reference in New Issue
Block a user