User exists? instead of find_first#5169
Conversation
|
Hello, @Dijkztra! This is your first Pull Request that will be reviewed by SourceLevel, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information. |
| raw = Devise.friendly_token | ||
| enc = OpenSSL::HMAC.hexdigest(@digest, key, raw) | ||
| break [raw, enc] unless klass.to_adapter.find_first({ column => enc }) | ||
| break [raw, enc] unless klass.exists?({ column => enc }) |
There was a problem hiding this comment.
In the another change you was using { key: value } and now { key => value }, what do you think about use one as default, I suggest { key: value }
|
@Dijkztra thanks for your contribution. Devise uses https://github.com/ianwhite/orm_adapter in order to work with Active Record and Mongo without having to worry about specifics of each, which is why it uses I am also unsure if mongo is working 100% in master right now, but we'll take a look at that eventually. |
|
I want to remove orm_adapter: #5823, so we might be able to implement something like this on our own side now. |
Issue: #5168
Benchmark in progress