title: Active Record join with params in condition
body: <p>I am not sure I know the best way to write this sql query in active record without totally writing it by hand. Essentially I want to write a combination of these two queries.</p>
  
  <p>This query is essentially the join I am trying to re-create. I want to make sure any entries returned are only those with the images with a image_path_processing flag set to false.</p>
  
  <pre><code>@entries = ContestEntry.joins(:entry_images).where(contest_id: @contest.id, entry_images: {
          image_path_processing: false
          }).limit(10)
  </code></pre>
  
  <p>However the issue I am running into with the query I am writing is that I need to include params from a url and I am not sure that the above syntax is properly removing sql_injection </p>
  
  <p>Here is what I am attempting to add the conditional join to.</p>
  
  <pre><code>@entries = ContestEntry.where("contest_id = ? and created_at &gt; ?",
        params[:contest_id], Time.at(params[:after].to_i + 1))
  </code></pre>