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)