if property.contract.nil?
property.create_contract(some_attributes)
else
property.contract.update_attributes(some_attributes)
end
Should do the trick. When you have a has_one or belongs_to association then you get build_foo and create_foo methods (which are like Foo.new and Foo.create). If the association already exists then property.contract is basically just a normal active record object.