[Rails] Re: Modelling Question - developing meta system

2010-04-07 Thread johnmcau...@gmail.com
Thanks Fred On Apr 7, 11:02 am, Frederick Cheung wrote: > On Apr 7, 9:32 am, "johnmcau...@gmail.com" > wrote: > > > > > > > Hey everyone, > > > Just a quick Q. > > > Can anybody point me to some resources regarding a modeling quandary I > > am in.  I have to develop a meta system that allows use

[Rails] Re: Modelling Question - developing meta system

2010-04-07 Thread Frederick Cheung
On Apr 7, 9:32 am, "johnmcau...@gmail.com" wrote: > Hey everyone, > > Just a quick Q. > > Can anybody point me to some resources regarding a modeling quandary I > am in.  I have to develop a meta system that allows users to specify > their own model variables.  For instance, I have a model Team

[Rails] Re: Modelling question

2010-03-08 Thread Jay P
Look up has_many and belongs_to On Mar 8, 4:03 pm, Greg Ma wrote: > Hi, > > I have these 3 models: > City :name > Product :name > city_preference :city_id, :product_id, :min, :max > > How do i create the associations between these tables? > Best > Greg > -- > Posted viahttp://www.ruby-forum.com/.

Re: [Rails] Re: Modelling Question

2010-03-07 Thread Anthony Gardner
Sorry for the delay in getting back on this but I've just got back from a weekend away. Okay, so Max, you and I agree on the modelling for this concept so that starts to narrow down where my problem is. To begin with, I thought my problem was because I had a join model acting as the parent to ano

Re: [Rails] Re: Modelling Question

2010-03-05 Thread Andy Jeffries
> > Also by using a string for the role_type you will have many Role > records with "MAIN_AUTHOR" for example. If you later decided that > "Primary Author" would be better you would have to change the string > in many records. I'm not saying MAIN_AUTHOR has to be displayed anywhere, display logi

Re: [Rails] Re: Modelling Question

2010-03-05 Thread Colin Law
On 5 March 2010 13:18, Andy Jeffries wrote: >> Book >> Authoring >> AuthoringRole >> Role >> Author > > I did this in 3 models, I don't know who models the OP's requirements more > closely, but for now here's my modelling: > http://gist.github.com/322710 You may have squashed it into fewer models

Re: [Rails] Re: Modelling Question

2010-03-05 Thread Andy Jeffries
> > Book > Authoring > AuthoringRole > Role > Author > I did this in 3 models, I don't know who models the OP's requirements more closely, but for now here's my modelling: http://gist.github.com/322710 Ready for the follow-up :-) Cheers, Andy -- You received this message because you are sub

[Rails] Re: Modelling Question

2010-03-05 Thread Max Williams
I would do: Book has_many :authorings has_many :authors, :through => :authorings Authoring belongs_to :book belongs_to :author has_many :authoring_roles has_many :roles, :through => :authoring_roles AuthoringRole belongs_to :authoring belongs_to :role Role has_many :authoring_