[Rails] Re: Validating the presence of two associated objects from both models

2009-12-30 Thread Evan Chaney
> 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

[Rails] Validating the presence of two associated objects from both models

2009-12-30 Thread Evan Chaney
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

[Rails] Understanding “create_association” and i nvalid objects

2009-12-24 Thread Evan Chaney
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

[Rails] Re: Can not figure out why validation fails

2008-10-22 Thread Evan Chaney
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