Copied question (snipped heavily) and answers to the list, assuming
Peter doesn't mind.   I hope I'm not wrong.  :)

On Sun, Feb 26, 2012 at 11:12 PM, Peter Pavlovich <[email protected]> wrote:
> Greetings,
>
> Sorry for all the questions. I hope you don't mind :)
>
> class Person < ActiveRecord::Base
>   has_one :address, :dependent => :destroy, :inverse_of => :person
> end
>
> class Address < ActiveRecord::Base
>   belongs_to :person, :inverse_of => :address
> end
>
> Here are my questions:
>
> Are these class definitions set up the right way?

Hobo does not support has-one relationships completely.   So if you
want the Hobo magic you have to use has_many and then constrain N to
[0,1] via validations.

Or just move all of the address fields into User.

P.S.   good call using inverse_of.   It's not strictly necessary in
Hobo but probably would have been if Hobo was first built in 2010
instead of 2007.  :)

Bryan

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to