Description:
uses empty? instead of length to check model validation errors when importing problems
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r338:0d4a8ccf5805 - - 2 files changed: 3 inserted, 3 deleted

@@ -160,7 +160,7
160 160 @problem, import_log = Problem.create_from_import_form_params(params,
161 161 old_problem)
162 162
163 - if @problem.errors.length != 0
163 + if !@problem.errors.empty?
164 164 render :action => 'import' and return
165 165 end
166 166
@@ -22,7 +22,7
22 22 import_params, problem = Problem.extract_params_and_check(params,
23 23 org_problem)
24 24
25 - if problem.errors.length!=0
25 + if !problem.errors.empty?
26 26 return problem, 'Error importing'
27 27 end
28 28
@@ -92,7 +92,7
92 92
93 93 file = params[:file]
94 94
95 - if problem.errors.length!=0
95 + if !problem.errors.empty?
96 96 return nil, problem
97 97 end
98 98
You need to be logged in to leave comments. Login now