Re: [Rails] Re: more than one table per model

2010-03-15 Thread Colin Law
On 15 March 2010 17:22, Frank Kim wrote: > Okay here's why I want to do it. > The first table contains just data. > The second table will be a view whose data can change depending on > other external factors.  It could change daily. > Yes this second table could be an association but I would have

Re: [Rails] Re: more than one table per model

2010-03-15 Thread Michael Pavling
On 15 March 2010 18:14, Greg Donald wrote: > On Mon, Mar 15, 2010 at 12:18 PM, Aldric Giacomoni > wrote: >> What possible benefit could you derive from this > > A second table is required when you have constraints that you don't > want interfering with your ability to save data to the first tabl

Re: [Rails] Re: more than one table per model

2010-03-15 Thread Greg Donald
On Mon, Mar 15, 2010 at 12:18 PM, Aldric Giacomoni wrote: > What possible benefit could you derive from this A second table is required when you have constraints that you don't want interfering with your ability to save data to the first table. has_one is very useful for this scenario. -- Greg

Re: [Rails] Re: more than one table per model

2010-03-15 Thread Frank Kim
Okay here's why I want to do it. The first table contains just data. The second table will be a view whose data can change depending on other external factors. It could change daily. Yes this second table could be an association but I would have preferred it not to be. On Mon, Mar 15, 2010 at 10:

[Rails] Re: more than one table per model

2010-03-15 Thread Aldric Giacomoni
Frank Kim wrote: > Hi everyone, > > I want to create a model that uses two tables for its data. Is that > possible or just a bad idea? I don't want to do the has_one because I > want to avoid the extra dereferencing. I usually avoid doing this, but... "I want to create a creature with two hands.