model - Data modelling of group and users -


i have web app lets users create groups. on front page of app user can - without registering - create group , add other users group entering names list of text inputs. user created group supposed able invite people on list adding email each of names. reason want user provide names , ivitations email later want user able try out app , functionality before registration.

so have 2 models group , user many-to-many relationship. user model requires unique email address can't create new user objects each user in group. how 1 make sure temporary users added groups mapped users created through invitation or if invited person has user in app?

i thinking creating profile model have name , belong group , user way each user have profile each of groups he/she belongs to. can't think of alternative there must one...

you need tools dump dat info brain database model :)

http://wb.mysql.com/ or http://www.sequelpro.com/

then need abstract application.

http://datamapper.org/

after install datamapper gems

gem install dm-core dm-do-adapter dm-migrations dm-sqlite-adapter dm-timestamps do_sqlite3

and can start playing. in sinatra app.

require 'rubygems' require 'dm-core' # http://datamapper.org/getting-started  configure :development    datamapper::setup(:default, "sqlite3://#{dir.pwd}/hohohodb.db")  end  #...  class user    include datamapper::resource    property :id,          serial   # http://datamapper.org/docs/properties   property :username,    string   property :email,       string   property :created_at,  datetime   property :updated_at,  datetime    validates_uniqueness_of, :email # http://datamapper.org/docs/validations   has n, :groups  end # create or upgrade tables @ once datamapper.auto_upgrade!  '/'     erb :index end  __end__  @@index ... 

hope can starting point # http://datamapper.org/docs/

have fun


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -