Hi, I have a profile table, module table and book table. A profile has many modules, a module has many books. Module belongs to profile and book belongs to module. When a user accesses a profile, the profile and the associated modules and books will be locked. Meaning that other users cannot edit or delete this profile and the associated modules and books. How can I achieve that? Someone please help. Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 1 Jul 2008, at 09:36, user splash wrote:> > Hi, > > I have a profile table, module table and book table. A profile has > many > modules, a module has many books. Module belongs to profile and book > belongs to module. > > When a user accesses a profile, the profile and the associated modules > and books will be locked. Meaning that other users cannot edit or > delete > this profile and the associated modules and books. > > How can I achieve that? Someone please help. >Set a flag on the profile to indicate it is being edited (or perhaps the user id of the editor so that you can say ''locked by bob'') and disallow edits based on that. Fred --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Peripheral observation: I''m going to be surprised if you don''t have a problem with the ''module table'' at some point since ''module'' is a reserved word in Ruby. On Jul 1, 5:56 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 1 Jul 2008, at 09:36, user splash wrote: > > > > > Hi, > > > I have a profile table, module table and book table. A profile has > > many > > modules, a module has many books. Module belongs to profile and book > > belongs to module. > > > When a user accesses a profile, the profile and the associated modules > > and books will be locked. Meaning that other users cannot edit or > > delete > > this profile and the associated modules and books. > > > How can I achieve that? Someone please help. > > Set a flag on the profile to indicate it is being edited (or perhaps > the user id of the editor so that you can say ''locked by bob'') and > disallow edits based on that. > > Fred--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---