I am getting a warning message when I scan my code with Brakeman's Tool. It states that there is an Unscoped call to the following query:
@applicant = Applicant.find(params[:id])
Here is the actual error message:
+------------+----------------------+---------+---------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| Confidence | Class | Method | Warning Type | Message |
+------------+----------------------+---------+---------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| Weak | ApplicantsController | show | Unscoped Find | Unscoped call to Applicant#find near line 25: Applicant.find(+params[:id]+) | |
+------------+----------------------+---------+---------------+-----------------------------------------------------------------------------------------------------------------------------------------+
But when I replace the above query with the following one then it's fine:
@applicant = Applicant.where("id = ?", params[:id]).first
I don't understand what's wrong with the first query.