Skip to content

Commit

Permalink
Add documentation and CHANGELOG entry to Application#verifier
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Dec 5, 2013
1 parent 2330017 commit 69ac53c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions railties/CHANGELOG.md
@@ -1,3 +1,15 @@
* Add `Application#verifier` method to return a application's message verifier.

This verifier can be used to generate and verify signed messages in the application.

message = Rails.application.verifier.generate('my sensible data')
Rails.application.verifier.verify(message)
# => 'my sensible data'

See the `ActiveSupport::MessageVerifier` documentation to more information.

*Rafael Mendonça França*

* The [Spring application * The [Spring application
preloader](https://github.com/jonleighton/spring) is now installed preloader](https://github.com/jonleighton/spring) is now installed
by default for new applications. It uses the development group of by default for new applications. It uses the development group of
Expand Down
9 changes: 9 additions & 0 deletions railties/lib/rails/application.rb
Expand Up @@ -158,6 +158,15 @@ def key_generator
end end
end end


# Return the application's message verifier.
#
# This verify can be used to generate and verify signed messages in the application.
#
# message = Rails.application.verifier.generate('my sensible data')
# Rails.application.verifier.verify(message)
# # => 'my sensible data'
#
# See the +ActiveSupport::MessageVerifier+ documentation to more information.
def verifier def verifier
@verifier ||= begin @verifier ||= begin
if config.respond_to?(:message_verifier_salt) if config.respond_to?(:message_verifier_salt)
Expand Down

0 comments on commit 69ac53c

Please sign in to comment.