title: How to limit a model to one record per day (Rails)?
body: <p>I would like to build a simple app where the user tracks how far he has run each day. I want it to be so that there is only one model entry per day. How do I limit the model to only allow one entry per day? I found a solution that suggests doing the following for a journal with unique daily journals: </p>
  
  <pre><code>add_index :journal_entries, [:user_id, :created_on], unique: true
  </code></pre>
  
  <p>However, I don't fully understand how to implement this. Do I have to have another model for this index? </p>
  
  <p>Thank you!</p>