Forum: Ruby on Rails Optional model relations

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.
azazel (Guest)
on 2007-04-08 03:28
I'm currently working on an application and have a bit of a problem with
relations.

The models Im working on right now are: User and Document

User has many documents
Documents always belong to one user

The thing is, there's a point where the user may have no documents at
all, because he hasn't created one yet.

Is 'has many' adequate for this relationship?
Benjamin C. (Guest)
on 2007-04-08 04:27
(Received via mailing list)
On Apr 7, 2007, at 4:28 PM, azazel wrote:

> The thing is, there's a point where the user may have no documents at
> all, because he hasn't created one yet.
>
> Is 'has many' adequate for this relationship?

Yup

--
Building an e-commerce site with Rails?
http://agilewebdevelopment.com/rails-ecommerce

Meet up at RailsConf:
http://railsconf2007.conferencemeetup.com/
This topic is locked and can not be replied to.