doorkeeper-gem/doorkeeper — pull request #484 by mtparet (2014-09-18 20:56:30+00:00)
Title: Performance improvment - avoid performing an order_by when not required

### Description
`.first` performs an `order_by` in addition of `limit(1)` and this cause performance problem on "big" table.
Use `.take` to avoid to perform an `order_by`.
(`.limit(1).to_a.first` as not implemented before rails 4.0)