Skip to content

Commit

Permalink
Eager load gardens on guide reindex.
Browse files Browse the repository at this point in the history
  • Loading branch information
guitsaru committed Mar 3, 2015
1 parent 8805de0 commit 8376bb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/guide.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def compatibilities

@compatibilities = []

User.each do |user|
User.includes(:gardens).each do |user|
@compatibilities << {
user_id: user.id.to_s, score: compatibility_score(user).to_i
}
Expand Down

0 comments on commit 8376bb5

Please sign in to comment.