plataformatec/devise — pull request #3093 by edelpero (2014-07-02 13:12:08+00:00)
Title: Replaces passing a block to devise controller's methods in favor of Template Pattern

Before:

```ruby
class Custom::RegistrationsController < Devise::RegistrationsController

def create
super do |resource|
if resource.persisted?
puts "User persisted successfully."
else
puts "User not persisted."
end
end
end

end
```

After:

```ruby
class Custom::RegistrationsController < Devise::RegistrationsController

protected
def after_sign_up_success(resource)
puts "User persisted successfully."
end

def after_sign_up_fails(resource)
puts "User not persisted."
end
end
```

I think this approach is better than the previous one because is more intention revealing. Every devise controller has it own template method.

### Devise::RegistrationsController

- after_sign_up_success
- after_sign_up_fails
- after_account_update_success
- after_account_update_fails
- after_account_destroyed

### Devise::ConfirmationsController

- after_confirmation_sent
- after_confirmation_success
- after_confirmation_fails

### Devise::PasswordsController

- after_reset_password_instructions_sent
- after_password_update_success
- after_password_update_fails

### Devise::SessionsController

- after_sign_in
- after_sign_out

### Devise::UnlocksController

- after_unlock_instructions_sent
- after_unlock_success
- after_unlock_fails