instance method
find_first
Ruby on Rails 3.0.20
Since v3.0.20 Last seen in v4.0.13Signature
find_first()
No documentation comment.
Source
# File activerecord/lib/active_record/relation/finder_methods.rb, line 339
def find_first
if loaded?
@records.first
else
@first ||= limit(1).to_a[0]
end
end
Defined in activerecord/lib/active_record/relation/finder_methods.rb line 339
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::FinderMethods