[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Migration with Dynamic Table Names?

martin.glaude

12/12/2005 7:46:00 PM

(This is my first real Ruby/Rails project, so please bare with me...)

I am working on a project that, effectively, has the following database
structure:

A master table:
Projects
- id
- project_name
- etc...

Many slave tables:
<project_name>_data
- id
- data_field (several)

So, instead of having one "slave data" table, we have many tables.
There are a variety of historical and practical reasons for this that,
while a less than ideal db structure, is needed in this case. Projects
will come and go, so new names will be created all of the time.

The slave tables will all have the same structure, so the same model
can be used (Slave_data, let's say). I understand that I'll need to
use set_table_name - I'm just not sure *where* to use it. I'm assuming
somewhere within the parent's model - but I'm a little iffy on the
details.

I guess they'll need to be something in or around the "has_many
:slave_data" type line?

5 Answers

james_b

12/12/2005 8:46:00 PM

0

martin.glaude@gmail.com wrote:
> (This is my first real Ruby/Rails project, so please bare with me...)

You may have better luck on the Rails mailing list:

http://lists.rubyonrails.org/mailman/list...



James

--

http://www.ru... - Ruby Help & Documentation
http://www.artima.c... - Ruby Code & Style: Writers wanted
http://www.rub... - The Ruby Store for Ruby Stuff
http://www.jame... - Playing with Better Toys
http://www.30seco... - Building Better Tools


T. Howard Pines, Jr.

11/17/2010 5:04:00 AM

0

On 11/16/2010 12:13 PM, dh@. wrote:
> On Fri, 12 Nov 2010 Goo agreed:
>
>> On Tue, 02 Nov 2010 18:28:58 -0400, dh@. pointed out:
>
>>> It's a rationalization for not ceasing to raise them because they are
>>> killed
>>
>> It is. That's exactly what it is
>
> Yes as I pointed out,

It is a rationalization; nothing more.


dh

11/24/2010 7:36:00 PM

0

On Wed, 27 Oct 2010 23:52:38 -0700, "Dutch" <no@email.com> wrote:

>"Chom Noamksy" <blahblah@blahblah.blah> wrote in message
>news:ocWdncEk8cR8jFTRnZ2dnUVZ_jCdnZ2d@giganews.com...
>> On 10/27/2010 10:14 PM, Dutch wrote:
>>> "Chom Noamksy" <blahblah@blahblah.blah> wrote
>>>> On 10/27/2010 12:50 PM, Dutch wrote:
>>>>> <dh@.> wrote
>>>>>> ?????????????????????????????????????????????????????????
>>>>>> There has to be something a bit "special" about people who
>>>>>> put their faith in the gross mi$nomer "animal rights", since for
>>>>>> one thing it wouldn't mean better lives, longer lives, rights, or
>>>>>> anything at all for domestic animals. Instead it would eliminate
>>>>>> them
>>>>>
>>>>> That is not insightful, clever, interesting, important or relevant in
>>>>> any way.
>>>>>
>>>>> Anyone reading your posts goes "huh?", scratches his head, says,
>>>>> "Another usenet fuckwit." and moves on to an intelligent comment.
>>>>
>>>> It was a valid point. Millions of domestic animals exist because we
>>>> want them to.
>>>
>>> It's true, but not worth mentioning. It has no place in a discussion
>>> about the morality of raising livestock. To put it another way, if we
>>> did NOT raise livestock no animal would be harmed in any way, we acquire
>>> no moral advantage by doing so.
>>
>> The human animal would be harmed because it would lose a great source of
>> food and nourishment that billions of us depend on. If you open your
>> mouth you'll notice a set of incisors, followed by a set of canines,
>> followed by a set of premolars, followed by a set of molars. The incisors
>> and canines are specifically designed for eating meat meat meat. The
>> premolar and molars are useful for holding a chunk of meat while severing
>> it with your incisors and canines. The molars and premolars also happen
>> to be good for processing non-animal foods. Now have a look at your
>> brain, the majority ingredient being protein. That brain was only made
>> possible by a high protein diet. Eating a high-protein diet is what
>> boosted the intellectual capacity of humans from monkey to king ape.
>> Since meat has one of the highest protein contents of common human foods
>> we must have eaten a looooot of meat during our evolution, and its far
>> easier to secure a supply of high value protein raising domestic animals,
>> rather than go chasing wild ones all the time.
>
>OK, I am a meat eater, I love meat and eat it every day.

I doubt that.

>I'm not disputing
>the utility to humans of raising animals. It's a useful activity and
>perfectly moral and right, provided the animals are not caused undue
>suffering.
>
>But that's not what I'm talking about, the issue is an esoteric one, not
>easily seen at first glance.

You mean sometimes you have a difficult time persuading
people to believe they should refuse to give the animals' lives
as much or more consideration than their deaths as I point out
that they should. One reason you sometimes have a difficult time
with that is because you can't provide even one respectable
reason why they should refuse.

>dh@ contends that since livestock "experience
>life" due to human's demand for animal products we are doing something
>admirable by "providing them with life".

ONLY when they're of positive value as you people so very
dishonestly refuse to acknowledge when you "explain" the
situation to your intended victims.

>I am saying that is a circular and
>self-serving sophistic argument.

When the truth is that it's a very significant aspect of the
situation which certainly does exist. So you're trying to
persuade people to believe that an existing aspect of human
influence on animals, in this case on livestock animals in
particular, is somehow circular, self-serving and sophistic. Do
you feel that way about gravity too?

>He even attacks vegetarians because their
>diets don't support these livestock lives.

I point out that they don't since they certainly do not but
I've known of people to estimate how many livestock animals they
think they've "saved" by being veg*n, when in fact they have
saved none by doing that. I've also known of PeTA to lie to
children that not drinking milk saves mother cows and their
babys. The fact that you consider my pointing out of their LIES
to be something to criticize again reveals you as being in favor
of the misnomer.
Whether or not someone should consider my pointing out that
veg*nism does nothing to help livestock to be an "attack" depends
on their pov. To people who do NOT want to help livestock with
their lifestyle it should be as much a compliment as an attack.
For people who DO want to help livestock with their lifestyle it
should just be useful information to warn people against trying
to do so by being veg*ns when the truth is that veg*nism does
nothing to help any livestock animals at all.

>That's why I call him a fuckwit.

You call me a fuckwit because you do whatever you can think
of to persuade people that they should refuse to consider the
lives of the animals we're discussing, because doing so works
against the elimination objective.

T. Howard Pines, Jr.

11/24/2010 7:42:00 PM

0

On 11/24/2010 11:36 AM, dh@. wrote:
> On Wed, 27 Oct 2010 23:52:38 -0700, "Dutch"<no@email.com> wrote:
>
>> "Chom Noamksy"<blahblah@blahblah.blah> wrote in message
>> news:ocWdncEk8cR8jFTRnZ2dnUVZ_jCdnZ2d@giganews.com...
>>> On 10/27/2010 10:14 PM, Dutch wrote:
>>>> "Chom Noamksy"<blahblah@blahblah.blah> wrote
>>>>> On 10/27/2010 12:50 PM, Dutch wrote:
>>>>>> <dh@.> wrote
>>>>>>> ?????????????????????????????????????????????????????????
>>>>>>> There has to be something a bit "special" about people who
>>>>>>> put their faith in the gross mi$nomer "animal rights", since for
>>>>>>> one thing it wouldn't mean better lives, longer lives, rights, or
>>>>>>> anything at all for domestic animals. Instead it would eliminate
>>>>>>> them
>>>>>>
>>>>>> That is not insightful, clever, interesting, important or relevant in
>>>>>> any way.
>>>>>>
>>>>>> Anyone reading your posts goes "huh?", scratches his head, says,
>>>>>> "Another usenet fuckwit." and moves on to an intelligent comment.
>>>>>
>>>>> It was a valid point. Millions of domestic animals exist because we
>>>>> want them to.
>>>>
>>>> It's true, but not worth mentioning. It has no place in a discussion
>>>> about the morality of raising livestock. To put it another way, if we
>>>> did NOT raise livestock no animal would be harmed in any way, we acquire
>>>> no moral advantage by doing so.
>>>
>>> The human animal would be harmed because it would lose a great source of
>>> food and nourishment that billions of us depend on. If you open your
>>> mouth you'll notice a set of incisors, followed by a set of canines,
>>> followed by a set of premolars, followed by a set of molars. The incisors
>>> and canines are specifically designed for eating meat meat meat. The
>>> premolar and molars are useful for holding a chunk of meat while severing
>>> it with your incisors and canines. The molars and premolars also happen
>>> to be good for processing non-animal foods. Now have a look at your
>>> brain, the majority ingredient being protein. That brain was only made
>>> possible by a high protein diet. Eating a high-protein diet is what
>>> boosted the intellectual capacity of humans from monkey to king ape.
>>> Since meat has one of the highest protein contents of common human foods
>>> we must have eaten a looooot of meat during our evolution, and its far
>>> easier to secure a supply of high value protein raising domestic animals,
>>> rather than go chasing wild ones all the time.
>>
>> OK, I am a meat eater, I love meat and eat it every day.
>
> I doubt that.

You have no valid reason to doubt it.


>
>> I'm not disputing
>> the utility to humans of raising animals. It's a useful activity and
>> perfectly moral and right, provided the animals are not caused undue
>> suffering.
>>
>> But that's not what I'm talking about, the issue is an esoteric one, not
>> easily seen at first glance.
>
> You mean sometimes you have a difficult time persuading
> people to believe they should refuse to give the animals' lives
> as much or more consideration

There is no consideration to be given. It is not "good" for the animals
to come into existence, versus never existing, and no one is doing
anything "bad" to any animals by not wanting any more domestic animals
to exist.

Your "consideration" is non-existent. It's a shabby rationalization,
nothing more. You feel the need to rationalize the fact that you kill
animals, but your rationalization is empty.


>
>> dh@ contends that since livestock "experience
>> life" due to human's demand for animal products we are doing something
>> admirable by "providing them with life".
>
> ONLY when

Never. It is *never* a benefit to the animals to cause them to live,
and therefore nothing admirable is being done by breeding domestic
animals into existence - never.


>> I am saying that is a circular and
>> self-serving sophistic argument.
>
> When the truth is

The truth is that your argument is nothing but self-serving sophistry,
and a *failed* attempt at rationalizing something that, for some reason,
causes you to feel ashamed.


>> He even attacks vegetarians because their
>> diets don't support these livestock lives.
>
> I point out that

You point out nothing.


>
>> That's why I call him a fuckwit.
>
> You call me a fuckwit because

Because you're a self-serving, sophistry-spouting, lying fuckwit.
That's the reason he and lots of others call you a fuckwit. There is no
logic behind your belief and conclusion. There's nothing but
self-serving sophistry.

T. Howard Pines, Jr.

11/25/2010 7:14:00 AM

0

On 11/24/2010 11:36 AM, dh@. wrote:
> On Wed, 27 Oct 2010 23:52:38 -0700, "Dutch"<no@email.com> wrote:


>> But that's not what I'm talking about, the issue is an esoteric one, not
>> easily seen at first glance.
>
> You mean sometimes you have a difficult time persuading
> people to believe they should refuse to give the animals' lives
> as much or more consideration

You can't even come close to giving any meaning to that nauseating,
empty expression. It simply doesn't mean anything.

What you really mean, and have always meant, is you want people to give
consideration to your wants. You want to consume animal products, and
you think people ought to treat that want as morally considerable, but
you can't give them a single reason why they should.

You do not consider the lives of animals for the animals sake, and you
never have. You can't. You have no clue how to do it. The only thing
you're looking at is your interest, not the interest of any animals.
All the froth about "considering" the lives of animals is utterly
transparent, but you're too stupid to see that.