aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/secure_token.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* `self.` is not needed when calling its own instance methodAkira Matsuda2017-01-051-1/+1
| | | | Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
* Add three new rubocop rulesRafael Mendonça França2016-08-161-1/+1
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* applies new string literal convention in activerecord/libXavier Noria2016-08-061-1/+1
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Revert "Merge pull request #20835 from ↵Kasper Timm Hansen2016-01-141-23/+2
| | | | | | | | | | | | | 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.
* Revert "Switch `has_secure_token` to `before_save`."Kasper Timm Hansen2016-01-091-4/+3
| | | | | | | 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.
* Switch `has_secure_token` to `before_save`.Kasper Timm Hansen2016-01-091-3/+4
| | | | | | | | 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.
* Support :if and :unless in has_secure_tokenGriffin Smith2016-01-091-2/+23
| | | | | Pass through :if and :unless options from has_secure_token to the generated before_create callback
* applies new doc guidelines to Active Record.Yves Senn2015-10-141-4/+4
| | | | | | | | | | | | | | | | | | | 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
* Update documentation to contain a 24 char token [ci skip]Roberto Miranda2015-05-011-1/+1
|
* Fix #has_secure_token documentation [ci skip]Tim Liner2015-02-201-2/+2
| | | | | It's actually #validates_uniqueness_of that can generate a race condition rather than #validates_presence_of.
* Do not overwrite secret token value when already present.Wojciech Wnętrzak2015-02-121-2/+1
| | | | | | | ``` user = User.create(token: "custom-secure-token") user.token # => "custom-secure-token" ```
* Fix Typo SecureToken for schema sample [ci skip]Jeroen K.2015-01-151-1/+1
|
* Fix Typo SecureToken [ci skip]Roberto Miranda2015-01-101-1/+1
|
* Switch Secure Token generation to Base58robertomiranda2015-01-091-18/+8
| | | | | | Update Secure Token Doc [ci skip] remove require securerandom, core_ext/securerandom already do that ref 7e006057
* Add has_secure_token to Active Recordrobertomiranda2015-01-041-0/+49
Update SecureToken Docs Add Changelog entry for has_secure_token [ci skip]