-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User has created an account with a blank address field #35
Labels
Comments
I was just looking at this.
Looks like they're following a |
OK, I'll let you dig into it. |
I think this is what's happening:
|
IMO, the above code flow is a bit broken. We shouldn't be updating the record when a user just wants to follow a "log me in to do X" URL. As a quick fix, I've just updated all users without an address: User.where(:address => nil).update_all(:address => '-')
# SQL (4.1ms) UPDATE "users" SET "address" = '-' WHERE "users"."address" IS NULL
#=> 6
User.where(:address => nil).count
# (1.4ms) SELECT COUNT(*) FROM "users" WHERE "users"."address" IS NULL
#=> 0
User.where(:address => '').update_all(:address => '-')
# SQL (224.0ms) UPDATE "users" SET "address" = '-' WHERE "users"."address" = ''
#=> 81
User.where(:address => '').count
# (1.5ms) SELECT COUNT(*) FROM "users" WHERE "users"."address" = ''
#=> 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is causing validation errors when they try to confirm their account:
An ActiveRecord::RecordInvalid occurred in user#confirm:
Validace je neúspešná: Address Musíte vložit adresu.
activerecord (3.2.22.3) lib/active_record/validations.rb:56:in `save!'
Actually looks like this is an older account, so they've somehow been able to delete the address information.
The text was updated successfully, but these errors were encountered: