diff --git a/lib/import/import_questions.rb b/lib/import/import_questions.rb index d57eb55..702f1bc 100644 --- a/lib/import/import_questions.rb +++ b/lib/import/import_questions.rb @@ -63,9 +63,9 @@ def import_questions # ... we check if there's an existing question with the same date tabled, uin and date_answer_corrected ... question = Question .all - .where( "date_tabled = '#{date_tabled.to_s}'" ) - .where( "uin = '#{uin.to_s}'" ) - .where( "date_answer_corrected = '#{date_answer_corrected.to_s}'" ) + .where( "date_tabled = ?", date_tabled.to_s ) + .where( "uin = ?", uin.to_s ) + .where( "date_answer_corrected = ?", date_answer_corrected.to_s ) .first # ... and we set the pertinent date to the date the answer was corrected. @@ -77,8 +77,8 @@ def import_questions # ... we check if there's an existing question with the same date tabled and uin ... question = Question .all - .where( "date_tabled = '#{date_tabled.to_s}'" ) - .where( "uin = '#{uin.to_s}'" ) + .where( "date_tabled = ?", date_tabled.to_s ) + .where( "uin = ?", uin.to_s ) .first # ... and we set the pertinent date to the date the question was answered. @@ -126,4 +126,4 @@ def import_questions end end end -end \ No newline at end of file +end