I'm working on a Rails app that existing users can invite additional members to join. The problem with this is that the User model exists in different states and in those different states, different sets of information is required.
For example, John is a member of the site and invites Mary. John enters Mary's name and email address, a user record is created in the database for Mary, and an invitation email is sent. After she joins, however, the required set of data changes and we require her to enter additional information (e.g. a password).
I'm still learning Ruby on Rails and I don't see any way to handle this using the standard validation techniques of validates_presence_of
, validates_format_of
, etc. Can anyone point me in the right direction