I have a web app that lets users create groups.
On the front page of the app any user can – without registering – create a group and add other users to the group by entering names into a list of text inputs. The user that created the group is then supposed to be able to invite the people on the list by adding an email to each of the names. The reason I want the user to provide just names initially and ivitations by email later is that I want the user to be able to try out the app and its functionality before registration.
So I have two models Group and User with a many-to-many relationship. The user model requires a unique email address so obviously I can’t create new user objects for each user in the group. So how would one make sure that the temporary users added to the groups will be mapped to the users that are created through the invitation or if the invited person already has a user in the app?
I was thinking about creating a Profile model that would have a name and belong to a group and a user but that way each user would have a profile for each of the groups he/she belongs to. I can’t think of another alternative but there must be one…
You need tools to dump dat info from your brain to a database model 🙂
http://wb.mysql.com/ or http://www.sequelpro.com/
Then you need to abstract that into your application.
http://datamapper.org/
After install all datamapper gems
gem install dm-core dm-do-adapter dm-migrations dm-sqlite-adapter dm-timestamps do_sqlite3
And finally you can start playing. In your Sinatra app.
Hope this can be a good starting point # http://datamapper.org/docs/
have fun