diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-11-19 22:34:32 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-12-04 22:56:47 -0200 |
commit | 69ac53cfec067103427945b3ef137b9ce07294c9 (patch) | |
tree | 0e7914cb2556057b49e27bc47f94b6716c11fc3d | |
parent | 233001749cd00e147f93c17c17e49e5f6094721e (diff) | |
download | rails-69ac53cfec067103427945b3ef137b9ce07294c9.tar.gz rails-69ac53cfec067103427945b3ef137b9ce07294c9.tar.bz2 rails-69ac53cfec067103427945b3ef137b9ce07294c9.zip |
Add documentation and CHANGELOG entry to Application#verifier
-rw-r--r-- | railties/CHANGELOG.md | 12 | ||||
-rw-r--r-- | railties/lib/rails/application.rb | 9 |
2 files changed, 21 insertions, 0 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index 0eda858cca..a42e942f9b 100644 --- a/railties/CHANGELOG.md +++ b/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 preloader](https://github.com/jonleighton/spring) is now installed by default for new applications. It uses the development group of diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index ccd97af655..320da8f100 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -158,6 +158,15 @@ module Rails 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 @verifier ||= begin if config.respond_to?(:message_verifier_salt) |