class User
  has_many :tips
  has_one :photo
end

user.tips.build(params)
user.photo.build(params)

Currently we have to use different syntax user.build_photo because 
user.photo can return nil. We can return some kind EmptyRecord instance the 
support the same methods that we have for has_many

user.photo.build
user.photo.create
user.photo.create!


-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to