Permalink
Browse files

Add documentation and CHANGELOG entry to Application#verifier

  • Loading branch information...
1 parent 2330017 commit 69ac53cfec067103427945b3ef137b9ce07294c9 @rafaelfranca rafaelfranca committed Nov 20, 2013
Showing with 21 additions and 0 deletions.
  1. +12 −0 railties/CHANGELOG.md
  2. +9 −0 railties/lib/rails/application.rb
View
@@ -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
@@ -158,6 +158,15 @@ def key_generator
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)

0 comments on commit 69ac53c

Please sign in to comment.