Hi Jon, > when auto_migrate! creates the table., I expected a field > shell_user_id. Nothing. I have tried other variations but no luck. > > Am I supposed to declare the field separate from the association? > like: > > property :shell_user_id, Integer > has 1, :shell_user, :class_name => User
The rule of thumb to remember is that when you use has() the property will be created in the Model at the *other end* of the association. If you want the property to be created in the current model, you use belongs_to. I know it's a bit confusing, and belongs_to almost screams for a few aliases because "belongs to" doesn't always clearly describe how a child is owned by a parent. We're going to resolve this in the near future in a way that should be alot clearer -- I won't say too much now because I haven't worked out all the details to know if what we're thinking of is possible yet. Dan (dkubb) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DataMapper" 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/datamapper?hl=en -~----------~----~----~----~------~----~------~--~---
