Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adds examples to FinderMethods#first [ci skip]

  • Loading branch information...
commit 011863673a353c334ddb2c93227dceadc5d7c3b6 1 parent 422d3a4
@alvaropereyra alvaropereyra authored
Showing with 1 addition and 0 deletions.
  1. +1 −0  activerecord/lib/active_record/relation/finder_methods.rb
View
1  activerecord/lib/active_record/relation/finder_methods.rb
@@ -87,6 +87,7 @@ def take!
# Person.where(["user_name = ?", user_name]).first
# Person.where(["user_name = :u", { :u => user_name }]).first
# Person.order("created_on DESC").offset(5).first
+ # Person.first(3) # returns the first objects fetched by SELECT * FROM people LIMIT 3
def first(limit = nil)
if limit
if order_values.empty? && primary_key
Please sign in to comment.
Something went wrong with that request. Please try again.