mongoid/mongoid — pull request #2895 by niedhui (2013-03-14 14:47:39+00:00)
Title: scope with a proc which return nil should still be chainable

just like activerecord, the scope should always be chainable, so we can write
```
scope :before_date, ->(date) { where(:date.lt => date) if date}
```
instead of
```
scope :before_date, ->(date) { date ? where(:date.lt => date) : all}
```