Could you tell me whats the best practice to create has_one relations?
f.e. if i have a user model, and it must have a profile...
How could i accomplish that
I had an issue with this and accepts_nested_attributes_for because if nested attributes were passed in, the associated model was created there. I ended up doing
after_create :ensure_profile_exists
has_one :profile
accepts_nested_attributes_for :profile
def ensure_profile_exists
profile || create_profile
end