Forum: Ruby on Rails has_many / belongs_to issues

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.
0457ef8d2a0f520e9cdc58511b0b0424?d=identicon&s=25 pb pb (p-b)
on 2009-05-07 22:47
Hi,

I just faced this problem today. I have a site which will have a USER
model and a SUBMISSION model. Apart from the cosmetics parts, each user
will be able to have multiple submissions, while each submission could
have or not a username.

Basically, registration to make a submission will be optional. My
question is will this work if someone tries to submit and it is not
registered?
B09a3f6cdc4797532647d2d264b5df49?d=identicon&s=25 Jodi Showers (jshow)
on 2009-05-07 22:51
(Received via mailing list)
Bogdan -

On 7-May-09, at 4:47 PM, Bogdan Pop wrote:

> question is will this work if someone tries to submit and it is not
> registered?

validation is under your control - just don't enforce
(validates_presence_of) for :user relation

J
0457ef8d2a0f520e9cdc58511b0b0424?d=identicon&s=25 pb pb (p-b)
on 2009-05-15 12:16
Jodi Showers wrote:
> Bogdan -
>
> On 7-May-09, at 4:47 PM, Bogdan Pop wrote:
>
>> question is will this work if someone tries to submit and it is not
>> registered?
>
> validation is under your control - just don't enforce
> (validates_presence_of) for :user relation
>
> J


Another small bump. When I create a new object. For example a
SUBMISSION, how can I select from a drop down list the USER it belongs
to?
This topic is locked and can not be replied to.