Refactored ActiveRecord `first` method to get rid of duplication.
rename method `find_first_records` to `find_first_with_limit`
Merge pull request #10898 from dmitry/find_first_refactor_duplication

Refactored ActiveRecord `first` method to get rid of duplication.