Forum: Ruby on Rails Finding the rhyme for has_many :through

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
John I. (Guest)
on 2006-05-03 21:07
(Received via mailing list)
Hi all,

I am NOT a person with English as my mother language and I haven't been
programming long enough to be natural in these kind of things. And if
that isn't bad enough, I am a newbie on Rails too... So please
enligthen.

I am trying to build a simple tool for my shop. I have many products
that I sell in my shop and of course I have many suppliers for the
products. Thus to express the relationship between products and
suppliers, I think I have to create a join model. Beside the product_id
and supplier_id the join model will also note the purchase_date, the
quantity, and the price. Am I right till this point? The question is,
what shall I name the join model? Please remember that I don't use
English daily.

I am looking for a word that rhyme. Rails Recipes book gives a very nice
example. Magazines has many readers through subscriptions. Readers has
many magazines through subscriptions. It clicks! It rhymes! Now... what
shall I name my join model?

Thank you,
John
James L. (Guest)
on 2006-05-03 21:08
(Received via mailing list)
On 5/3/06, John I. <removed_email_address@domain.invalid> wrote:
> what shall I name the join model? Please remember that I don't use
> English daily.
>
> I am looking for a word that rhyme. Rails Recipes book gives a very nice
> example. Magazines has many readers through subscriptions. Readers has
> many magazines through subscriptions. It clicks! It rhymes! Now... what
> shall I name my join model?

"Rhyme" probably isn't what you mean.  The "It clicks!" part makes sense
though.

Personally, given your description, I'd go with "Purchase".  It's a
noun and a verb in English.  "I purchase food at the store."  "I went
home from the store with my purchase."

"Order" is also commonly used in these situations.

-- James
Brian H. (Guest)
on 2006-05-03 21:08
(Received via mailing list)
On May 3, 2006, at 11:49 AM, James L. wrote:
>
> "Rhyme" probably isn't what you mean.  The "It clicks!" part makes
> sense though.
>
> Personally, given your description, I'd go with "Purchase".  It's a
> noun and a verb in English.  "I purchase food at the store."  "I went
> home from the store with my purchase."
>
> "Order" is also commonly used in these situations.

I think I'd probably go with Purchase, although I was also thinking
about "Restocking", since it could be a bit more descriptive of the
kind of transaction you are having with your supplier, where a
Purchase is also something your customers make, from the products you
have in stock...

-Brian
John I. (Guest)
on 2006-05-03 21:08
(Received via mailing list)
James L. wrote:
> "Rhyme" probably isn't what you mean.  The "It clicks!" part makes sense
> though.

Ah... thank you...

> Personally, given your description, I'd go with "Purchase".  It's a
> noun and a verb in English.  "I purchase food at the store."  "I went
> home from the store with my purchase."

A product has many suppliers through purchase. A supplier has many
products through purchase.

Doesn't it still sound awkward?

> "Order" is also commonly used in these situations.

Order is probably a better fit. However... I am planning to use order
for product-order-customer. Maybe I can use purchase_orders and
sales_orders.

> -- James

Thanks a bunch James! Really appreciate it.
John.
Wilson B. (Guest)
on 2006-05-03 21:08
(Received via mailing list)
On 5/3/06, John I. <removed_email_address@domain.invalid> wrote:
> A product has many suppliers through purchase. A supplier has many
> products through purchase.
>
> Doesn't it still sound awkward?
>
> > "Order" is also commonly used in these situations.
>
> Order is probably a better fit. However... I am planning to use order
> for product-order-customer. Maybe I can use purchase_orders and
> sales_orders.
>

What about:
"A product has many suppliers through fulfillments"
"A supplier has many products through fulfillments"
?
John I. (Guest)
on 2006-05-03 21:14
(Received via mailing list)
Wilson B. wrote:
> What about:
> "A product has many suppliers through fulfillments"
> "A supplier has many products through fulfillments"
> ?

Thanks! You guys really help a lot.

John
This topic is locked and can not be replied to.