elioncho
(elioncho)
1
Hello,
I am used tO the :include parameter always inside a find method:
@posts = Post.find(:all, :include => [:user])
How can I wire the :include to the relationship outside the find
method?
@posts = Post.find(:all)
@posts...(HERE THE METHOD TO WIRE UP THE USER TO EACH POST)
Thanks
elioncho
(elioncho)
2
I just want to know if its possible.
elioncho
(elioncho)
3
I want to reproduce the internals of eager loading.
I want to reproduce the internals of eager loading.
If you're feeling evil you can do something like
Post.send :preload_associations @posts, :user
(This is a protected method - could easily change between releases of
rails)
Fred