applicake/doorkeeper — pull request #123 by petergoldstein (2012-07-28 22:53:29+00:00)
Title: i18n for validator, flash messages

This pull request moves the validator messages and flash messages to the locale file. A couple of comments about the pull:

1. The validator uses the conventions established by the ORM libraries for the localization keys for model related strings.
2. As a result of (1), each validator message actually appears twice in the locale file - once in the 'activerecord' location and again in the 'mongoid' location. This is unavoidable if we want to support both libraries and follow convention
3. The flash messages were added using the conventions of the Platformatec responders library (https://github.com/plataformatec/responders). This is as close to a standard convention for Flash messages as I could find.
4. Because of these changes the RedirectUriValidator spec had to be updated to an integration spec and changed to use an Application factory. It was proving impossible to get ActiveModel to accept a configured name in conjunction with the anonymous class. ActionModel::Naming doesn't really support dynamic naming by its subclasses without a lot of work.

Tests all pass in ActiveRecord and Mongoid.