soveran/ohm — pull request #168 by thejchap (2014-05-04 00:25:59+00:00)
Title: Add 'limit' argument to Ohm::Model.list

Gauging interest...I'm about to implement this for a project and figured I'd see if it could be useful for anyone else, if not here then maybe in `ohm/contrib`

This PR would add a 3rd `limit` argument to a list association that would simply `LPOP` the first/oldest id in a list association once the limit is exceeded.

Example:
```ruby
Activity = Class.new Ohm::Model

class Feed < Ohm::Model
list :activities, :Activity, limit: 2
end

feed = Feed.create
activity1 = Activity.create
activity2 = Activity.create
activity3 = Activity.create

feed.activities.push activity1
feed.activities.push activity2
feed.activities.push activity3

feed.activities.size #=> 2
feed.activities.include? activity1 #=> false
```