My app lets users to create educational tests on various subjects, and then another users can complete them. Each User has some kind of Profile. There should be opportunity to add tests they like in their profiles, so they don''t need to seatch it it then they want to complete it again. The problem is that I don''t know what relations should be between test and profile. I don''t want them belong to each other, because the logic is not like they belong to each other, User can simly add shortcut and easily find required test from his profile. So I can do this without a relation? Or I can''t? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/VmLPlgEGeW4J. For more options, visit https://groups.google.com/groups/opt_out.
On 17 April 2013 15:07, Barry <burmanz-JGs/UdohzUI@public.gmane.org> wrote:> My app lets users to create educational tests on various subjects, and then > another users can complete them. > Each User has some kind of Profile. There should be opportunity to add tests > they like in their profiles, so they don''t need to seatch it it then they > want to complete it again. The problem is that I don''t know what relations > should be between test and profile. > I don''t want them belong to each other, because the logic is not like they > belong to each other, User can simly add shortcut and easily find required > test from his profile. > So I can do this without a relation? Or I can''t?What are the attributes of a Profile object? Can a use have more than one profile? Can a profile be associated with more that one user? I presume a profile can have multiple tests Can a test be in more than one profile? Colin> > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/VmLPlgEGeW4J. > For more options, visit https://groups.google.com/groups/opt_out. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
1) Just Added Tests 2) No 3)No 4) Yes 5) Yes Basically it is like has many tests and belongs to many tests среда, 17 апреля 2013 г., 18:12:17 UTC+4 пользователь Colin Law написал:> > On 17 April 2013 15:07, Barry <bur...-JGs/UdohzUI@public.gmane.org <javascript:>> wrote: > > My app lets users to create educational tests on various subjects, and > then > > another users can complete them. > > Each User has some kind of Profile. There should be opportunity to add > tests > > they like in their profiles, so they don''t need to seatch it it then > they > > want to complete it again. The problem is that I don''t know what > relations > > should be between test and profile. > > I don''t want them belong to each other, because the logic is not like > they > > belong to each other, User can simly add shortcut and easily find > required > > test from his profile. > > So I can do this without a relation? Or I can''t? > > What are the attributes of a Profile object? > Can a use have more than one profile? > Can a profile be associated with more that one user? > I presume a profile can have multiple tests > Can a test be in more than one profile? > > Colin > > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "Ruby on Rails: Talk" group. > > To unsubscribe from this group and stop receiving emails from it, send > an > > email to rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. > > To post to this group, send email to rubyonra...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<javascript:>. > > > To view this discussion on the web visit > > https://groups.google.com/d/msg/rubyonrails-talk/-/VmLPlgEGeW4J. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/ePq1fCs5F1sJ. For more options, visit https://groups.google.com/groups/opt_out.
On 17 April 2013 15:46, Barry <burmanz-JGs/UdohzUI@public.gmane.org> wrote: I have re-ordered your reply so it makes sense, please don''t top post. Thanks> > среда, 17 апреля 2013 г., 18:12:17 UTC+4 пользователь Colin Law написал: >> >> On 17 April 2013 15:07, Barry <bur...-JGs/UdohzUI@public.gmane.org> wrote: >> > My app lets users to create educational tests on various subjects, and >> > then >> > another users can complete them. >> > Each User has some kind of Profile. There should be opportunity to add >> > tests >> > they like in their profiles, so they don''t need to seatch it it then >> > they >> > want to complete it again. The problem is that I don''t know what >> > relations >> > should be between test and profile. >> > I don''t want them belong to each other, because the logic is not like >> > they >> > belong to each other, User can simly add shortcut and easily find >> > required >> > test from his profile. >> > So I can do this without a relation? Or I can''t? >> >> What are the attributes of a Profile object?> 1) Just Added Tests>> Can a use have more than one profile?> 2) No>> Can a profile be associated with more that one user?> 3)No>> I presume a profile can have multiple tests> 4) Yes>> Can a test be in more than one profile?> 5) Yes > Basically it is like has many tests and belongs to many testsI don''t understand why you have a Profile object at all, is it not just part of the User? As you say, the relation between tests and profile (or user) is has_and_belongs_to_many or has_many through. I prefer has_many through as I find it easier to think about. Have a look at the Rails Guide on ActiveRecord Relations if you don''t understand how to do this. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.