class Post include DataMapper::Resource property :id, Serial belongs_to :author, :default => lambda { |r, a| Author.first } end class Author include DataMapper::Resource property :id, Serial property :name, String has n, :posts end bill = Author.create(:name => "Bill") dave = Author.create(:name => "Dave") post = Post.create(:author_id => dave.id) puts post.author.name => "Bill" # default value of author (on post) is beating out the author_id passed in to create