plataformatec/devise — pull request #2978 by rossta (2014-04-15 21:34:09+00:00)
Title: Support multiple warden configuration blocks

This pull request extends the behavior of `Devise.warden` such that calling it multiple times with different blocks will result in a call to each block on `Devise.configure_warden!` rather than "last block wins".

This is especially useful for plugins that wish to extend warden functionality without clobbering base app configuration or vice versa:

```ruby
# my Rails app
# config/initializers/devise.rb
config.warden do |manager|
manager.oauth(:twitter)
end

# a Rails engine
# lib/open_sesame/engine.rb
config.warden do |manager|
manager.serialize_into_session(:opensesame) { |user| user.login }
manager.serialize_from_session(:opensesame) { |login| OpenSesame::User.find(login) }
end
```