scambra/devise_invitable — pull request #282 by wojtha (2013-02-17 14:18:44+00:00)
Title: Add conditional validation support for resource model

This patch enables conditional validation during the invitation creation phase for the invitee resource.

It adds flag `conditional_validation_on_invite` which enables possibility of conditional validation of the invitee resource via the `invite_conditional_validation?` method.

**initializers/devise.rb**
```ruby
config.invite_key = {firstname: nil, lastname: nil, email: nil}
config.validate_on_invite = true
config.conditional_validation_on_invite = true
```

**models/user.rb**
```ruby
class User
validates :username, presence: true, unless: :invite_conditional_validation?
validates :firstname, :lastname, presence: true, length: { minimum: 2, maximum: 30 }
validates :email, email_format: { message: 'is not looking good' }
end
```

For more about my motivation see my comment at https://github.com/scambra/devise_invitable/issues/280#issuecomment-13684564