Hi all, shouldn't the last line of the below code return true with
identity map working? Do I need to switch identity map for a given
model on somewhere?

Thanks for any hint!
Ingo



require 'rubygems'
require 'dm-core'

DataMapper.setup(:default, 'sqlite3::memory:')

class Post
  include DataMapper::Resource
  property :id, Serial
  has n, :comments
end

class Comment
  include DataMapper::Resource
  property :id, Serial
  belongs_to :post
end

DataMapper.auto_migrate!

p = Post.create
10.times{ Comment.create(:post => p) }

puts Comment.all.all? { |c| c.post.object_id == p.object_id }
=> false

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

Reply via email to