sig
2011-Oct-25 12:40 UTC
help! is this activerecord modelling anywhere near correct/optimal?
I''m a n00b & need help with getting some active record modelling right. i''ve tried to read up and have experimented a lot with varaible in the console & I *think* i''m getting it, but this is my first rails project and would really appreciate some wisened feedback from experts :) this is my attempt - apologies for the pidgen diagram - am still learning somewhat! https://minus.com/mnifjW1E4 thanks for any help :) -- 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.
Colin Law
2011-Oct-25 21:04 UTC
Re: help! is this activerecord modelling anywhere near correct/optimal?
On 25 October 2011 13:40, sig <danielnickless-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m a n00b & need help with getting some active record modelling > right. > > i''ve tried to read up and have experimented a lot with varaible in the > console & I *think* i''m getting it, but this is my first rails project > and would really appreciate some wisened feedback from experts :) > > this is my attempt - apologies for the pidgen diagram - am still > learning somewhat! > > https://minus.com/mnifjW1E4Not sure exactly what you are asking. There are several errors on your diagram though You have missed the id off events_services unless that is actually showing a habtm between events and services Why has service got an event_id? You either need a belongs_to between service and tender and the associated id. You have info_id instead of info_type_id in info. You have habtm between user and conversation_user and that and Conversation where I guess you mean has_many/belongs to. I can''t believe you both those relationships between user and conversation, it appears that a conversation is linked to users via two paths which is probably wrong. All in all the whole thing is too complex for a starting point, particularly for a beginner. Pick a section of the problem, model that and develop it using TDD. Then add some more. 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 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.