| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
|
| |
|
|
|
|
| |
Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
|
|
|
|
|
|
|
|
| |
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces
Fix all violations in the repository.
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
glittershark/if-and-unless-in-secure-token"
This reverts commit 224eddfc0eeff6555ae88691306e61c7a9e8b758, reversing
changes made to 9d681fc74c6251d5f2b93fa9576c9b2113116680.
When merging the pull request, I misunderstood `has_secure_token` as declaring a model
has a token from birth and through the rest of its lifetime.
Therefore, supporting conditional creation doesn't make sense. You should never mark a
model as having a secure token if there's a time when it shouldn't have it on creation.
|
|
|
|
|
|
|
| |
Mistakenly interpreted the test case as a sign that we should switch to
before_save, when the original pitch use case was intended as before_create.
Revert a3ab6ad00872d24d4d87637f93fdae798d0edc79.
|
|
|
|
|
|
|
|
| |
Adding `if` and `unless` support doesn't bode well if the callback to assign
a token only runs on create.
Switch to `before_save`, but keep the conditional so that no token already
assigned is overriden.
|
|
|
|
|
| |
Pass through :if and :unless options from has_secure_token to the
generated before_create callback
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The focus of this change is to make the API more accessible.
References to method and classes should be linked to make it easy to
navigate around.
This patch makes exzessiv use of `rdoc-ref:` to provide more readable
docs. This makes it possible to document `ActiveRecord::Base#save` even
though the method is within a separate module
`ActiveRecord::Persistence`. The goal here is to bring the API closer to
the actual code that you would write.
This commit only deals with Active Record. The other gems will be
updated accordingly but in different commits. The pass through Active
Record is not completely finished yet. A follow up commit will change
the spots I haven't yet had the time to update.
/cc @fxn
|
| |
|
|
|
|
|
| |
It's actually #validates_uniqueness_of that can generate a race condition
rather than #validates_presence_of.
|
|
|
|
|
|
|
| |
```
user = User.create(token: "custom-secure-token")
user.token # => "custom-secure-token"
```
|
| |
|
| |
|
|
|
|
|
|
| |
Update Secure Token Doc [ci skip]
remove require securerandom, core_ext/securerandom already do that ref 7e006057
|
|
Update SecureToken Docs
Add Changelog entry for has_secure_token [ci skip]
|