Thanks tony...
I'm sorry, i made a mistake with the navigability of the association...

    -------------      *                1    ------------
  |    Class0    |       ----------->    |    Class1    |
    -------------                              ------------

If I define this in this way:
class Class0
    include DataMapper::Resourse
          ----  properties -----
    has 1, :class1
end

class Class0
    include DataMapper::Resourse
          ----  properties -----
     belongs_to :class0
end

in the class1s table is the class0_id, but I need the class1_id in the class0s table...

I hope you can understand, i'm not good with english, i'm in Argentina...

Thanks...




Tony Mann escribió:
class Class1
  include Datamapper::Resource
  property :id, Serial
  belongs_to :class0
end

class Class0
  include Datamapper::Resource
  property :id, Serial
  has n, :class1
end

On Fri, Jan 30, 2009 at 3:57 AM, Lucas Kloster <[email protected]> wrote:
Hello, i'm starting with ruby and DataMapper...
How can I define this association?:

    -------------      *               1     ------------
  |    Class0    |      < -----------    |    Class1    |
    -------------                              ------------

I need in the class1s table the class0_id...

Thanks!

--
Lucas Kloster
[email protected]



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---



--
Lucas Kloster
[email protected]

Reply via email to