Description:
uses empty? instead of length to check model validation errors when importing problems
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r338:0d4a8ccf5805 - - 2 files changed: 3 inserted, 3 deleted
@@ -160,7 +160,7 | |||||
|
160 | @problem, import_log = Problem.create_from_import_form_params(params, |
|
160 | @problem, import_log = Problem.create_from_import_form_params(params, |
|
161 | old_problem) |
|
161 | old_problem) |
|
162 |
|
162 | ||
|
163 |
- if @problem.errors. |
|
163 | + if !@problem.errors.empty? |
|
164 | render :action => 'import' and return |
|
164 | render :action => 'import' and return |
|
165 | end |
|
165 | end |
|
166 |
|
166 |
@@ -22,7 +22,7 | |||||
|
22 | import_params, problem = Problem.extract_params_and_check(params, |
|
22 | import_params, problem = Problem.extract_params_and_check(params, |
|
23 | org_problem) |
|
23 | org_problem) |
|
24 |
|
24 | ||
|
25 |
- if problem.errors. |
|
25 | + if !problem.errors.empty? |
|
26 | return problem, 'Error importing' |
|
26 | return problem, 'Error importing' |
|
27 | end |
|
27 | end |
|
28 |
|
28 | ||
@@ -92,7 +92,7 | |||||
|
92 |
|
92 | ||
|
93 | file = params[:file] |
|
93 | file = params[:file] |
|
94 |
|
94 | ||
|
95 |
- if problem.errors. |
|
95 | + if !problem.errors.empty? |
|
96 | return nil, problem |
|
96 | return nil, problem |
|
97 | end |
|
97 | end |
|
98 |
|
98 |
You need to be logged in to leave comments.
Login now