I have a User model. Every User has a document. Then I have a Delegate model. User can have many delegates and one Delegate can have many users. Every Delegate has a document. Do you think it is better to create a Document model and put a one to one association to User and Delegate or put a document attribute in User and Delegate models? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Look how I understand that: One User can be the owner of some document, the he can create many delegates and associate other users to that delegate. The delegate then give access to the document. So the user that has a document, can share with others just by creating delegates to that document, right? -- André Moraes http://andredevchannel.blogspot.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
To further muddy the waters, are Delegates also Users in your system (similar to the "Manager is an Employee" problem)? On Jan 13, 6:12 am, Mauro <mrsan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Do you think it is better to create a Document model and put a one to > one association to User and Delegate or put a document attribute in > User and Delegate models?-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Msan Msan wrote in post #974585:> I have a User model. > Every User has a document. > Then I have a Delegate model. > User can have many delegates and one Delegate can have many users. > Every Delegate has a document. > Do you think it is better to create a Document model and put a one to > one association to User and Delegate or put a document attribute in > User and Delegate models?Do the simplest thing that could possibly work. In this case, that''s probably just making document a field in Delegate. If that proves to be inadequate for your application logic, then refactor it to a separate model. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org Sent from my iPhone -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
On 13 January 2011 13:35, djangst <djangst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> To further muddy the waters, are Delegates also Users in your system > (similar to the "Manager is an Employee" problem)?No, User are people who should be delivered bags, which can also be delivered to their representatives. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
2011/1/13 André Moraes <andrebq-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> Look how I understand that: > > One User can be the owner of some document, the he can create many > delegates and associate other users to that delegate. > The delegate then give access to the document. > > So the user that has a document, can share with others just by > creating delegates to that document, right?No, User are people who should be delivered bags, when delivered they must show a personal document to operator. Bags can also be delivered to their delegates, also the delegate must show a personal document. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Does a document have only one attribute at the present time? Could it reasonably be expected to have more at some point in the future? In that case I would probably model it separately. It probably won''t matter, though; I''d expect the amount of work to be the same with either approach. On Jan 13, 10:36 am, Mauro <mrsanna1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> No, User are people who should be delivered bags, when delivered they > must show a personal document to operator. > Bags can also be delivered to their delegates, also the delegate must > show a personal document.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.