Forum: Ruby on Rails validates_associated questions

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.
786aca6b4728622a57a2c34fb1c9f0cd?d=identicon&s=25 Rich Brant (Guest)
on 2006-02-03 22:02
(Received via mailing list)
I'm trying to validate a User model object that belongs_to a company

class User < ActiveRecord::Base

	belongs_to :company
	validates_associated :company, :message=>"Company can not be blank"
end

Now, if my Company class has the following:

validates_presence_of :name


shouldn't that result in the error message beign added to the error
messages for the user??
This topic is locked and can not be replied to.