Displaying 1 result from an estimated 1 matches for "e7374658".
Did you mean:
2.374658
2006 Jul 29
3
Validating two models
Hi,
I have a model Account wich "has_one" model called UserData. Both models
use validation.
# Model contains user name, email etc.
class Account < ActiveRecord::Base
has_one :user_data, :foreign_key => "user_id"
validates_presence_of :email
end
# Model contains firstname, lastname etc.
class UserData < ActiveRecord::Base