On 22 September 2011 22:42, Romain 'Maz' BILLOIR <[email protected]> wrote: > (Frenchy, sorry =)) > > Hi everyone, i'm working on a web browser based game: > every player have got some ants and i want every ants of each player > to have a unique name: > > Player 1: > ant 1 > ant 2 > ant 3 > Player 2: > ant 1 > ant 2 > ant 3 > ant 4 > ... > > To do that i need to create player1_seq and player2_seq and increment > the player sequence whenever the player create an ant so i need to > create sequence whenever a player subscribe.
Why not just use the id of the ant? If you need them to start from 1 for each player then when you make an new ant look up the highest number for that player's ants and add one to that. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

