title: Selecting the newest record of a hasMany relationship
body: <p>I have 2 basic models in my CakePHP application: User and Login. A user has a hasMany relation with Logins (i.e., a new login record is created everytime the user logs in). </p>
  
  <p>Now, I want to make 2 relations from the User model to the Login model:
  User hasMany Login
  and
  User hasOne lastLogin</p>
  
  <p>This last relation should only include the last record of the Login model for the selected user.</p>
  
  <p>I tried this as follows:</p>
  
  <pre><code>var $belongsTo = array
  (
      'LastLogin' =&gt; array
      (
          'className' =&gt; 'Login',
          'order' =&gt; 'LastLogin.created DESC',
          'limit' =&gt;  1
  
      )
  ); 
  </code></pre>
  
  <p>However, this doesn't work. Any ideas on how to get this working?</p>