Commit bdbf3530c2501442b65787fa9f9565e6963590bc
1 parent
1e637035
Exists in
master
and in
1 other branch
do not load all the problems to find an error
Showing
1 changed file
with
1 additions
and
2 deletions
Show diff stats
app/models/app.rb
... | ... | @@ -74,8 +74,7 @@ class App |
74 | 74 | end |
75 | 75 | |
76 | 76 | def find_or_create_err!(attrs) |
77 | - Err.any_in(:problem_id => problems.map { |a| a.id }). | |
78 | - where(attrs).first || problems.create!.errs.create!(attrs) | |
77 | + Err.where(attrs).first || problems.create!.errs.create!(attrs) | |
79 | 78 | end |
80 | 79 | |
81 | 80 | # Mongoid Bug: find(id) on association proxies returns an Enumerator | ... | ... |