alphagov/signonotron2 — pull request #129 by vinayvinay (2013-12-11 17:41:53+00:00)
Title: Getting ready to validate users before inviting

the addition of an organisation admin role requires
a validation that the organisation can't be blank for
an organisation admin (obviously !). this requires
us to turn-on [devise validate_on_invite](https://github.com/scambra/devise_invitable#model-configuration).

the existing code assumed that permissions coming
in as nested attributes of users won't be validated
during invite. which needed to be fixed.

the use of [```inverse_of```](http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#label-Bi-directional+associations) makes sure Rails understands
that permissions can be validated only once a user gets
saved, till then it can validate against an in memory user.