Does datamapper model association work with Enumerators ?

9 views
Skip to first unread message

stcatz

unread,
Mar 22, 2012, 1:16:07 AM3/22/12
to DataMapper
Hi,

Suppose I have a one to many association between Author and Post.

When I am trying to find out all posts authors with each enumberators,
I got errors.

@posts = Post.all

@posts.each do |b|
p b.author
end

errors:
Rake::ConfigurationError: Please specify the repository path via
the :repository variable
from /home/stcatz/.rvm/gems/ruby-1.9.3-p0/gems/rake-remote_task-2.0.6/
lib/rake/remote_task.rb:311:in `block in mandatory'
from /home/stcatz/.rvm/gems/ruby-1.9.3-p0/gems/rake-remote_task-2.0.6/
lib/rake/remote_task.rb:268:in `call'
from /home/stcatz/.rvm/gems/ruby-1.9.3-p0/gems/rake-remote_task-2.0.6/
lib/rake/remote_task.rb:268:in `block in fetch'
from /home/stcatz/.rvm/gems/ruby-1.9.3-p0/gems/rake-remote_task-2.0.6/
lib/rake/remote_task.rb:321:in `block in protect_env'
.....

But if I find it directly, it is ok.

@post = Post.first
p @post.author

So, why did this error report out ?



Reply all
Reply to author
Forward
0 new messages