Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
flyerhzm committed Oct 27, 2010
1 parent 1af96c2 commit 0b3284e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Expand Up @@ -16,20 +16,24 @@ define it in your Gemfile


include the module after Mongoid::Document include the module after Mongoid::Document


class User class Post
include Mongoid::Document include Mongoid::Document
include Mongoid::EagerLoading include Mongoid::EagerLoading
referenced_in :user
end end


then you can use the eager loading like then you can use the eager loading like


Post.includes(:user) Post.includes(:user)
Post.includes(:user, :comment) Post.includes(:user, :comment)


eager loading can be only used on referenced_in, references_one and references_many associations.

Benchmark Benchmark
--------- ---------


I also ruun a [benchmark][1] on my local computer, the result is as follows I also run a [benchmark][1] on my local computer, the result is as follows


Starting benchmark... Starting benchmark...
user system total real user system total real
Expand Down

0 comments on commit 0b3284e

Please sign in to comment.