title: How to get the Nth row (or record) with Datamapper
body: <p>I'm looking for a more datamappery way of doing the following (since the code below is dependent on sqlite):</p>
  
  <pre><code>id = repository(:default).adapter.query(
    'SELECT id FROM ads ORDER BY random() LIMIT 1'
  )
  @ad = Ad.get(id)
  </code></pre>
  
  <p>My hope was to do something like:</p>
  
  <pre><code>@ad = Ad.get(:offset=&gt;rand(Ad.all.count))
  </code></pre>
  
  <p>or</p>
  
  <pre><code>@ad = Ad.find(:offset=&gt;rand(Ad.all.count), :limit=&gt;1)
  </code></pre>
  
  <p>Basically I'm just looking for a way to get a row by offset or row number. Apologies if this has been asked already, I'm not sure what vocabulary to search for as I'm new to both Ruby and Datamapper</p>