> That way you can't save a conversation without assigning it a leader,
> but the leader doesn't have to be saved yet.
Well, that’s where I’m at right now. I’d like to be in a situation where
Conversation validates that it has a Leader and Leader validates it has a
Conversation before either is
I have a model “Conversation” and a model “Leader”. A Conversation is always
led by exactly 1 Leader.
I’ve overridden Conversation’s “validate” method to validate the presence of an
associated Leader model.
If I add a similar validation to the Leader model, however, Conversations can
no longer
The documentation on the “create_association” method of the “belongs_to”
association reads:
> create_association(attributes = {})
> Returns a new object of the associated type that has been instantiated with
> attributes, linked to this object through a foreign key, and that has already
> been
Thanks, Mark.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL P
4 matches
Mail list logo