aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlvaro Pereyra <alvaro@xendacentral.com>2012-05-28 02:28:35 -0500
committerAlvaro Pereyra <alvaro@xendacentral.com>2012-05-28 02:29:01 -0500
commit011863673a353c334ddb2c93227dceadc5d7c3b6 (patch)
treeee0c7ee2580568a83e0d5d413e3bb6994e1b3066
parent422d3a4f042df8ea4bd42b0dca38a295a218c376 (diff)
downloadrails-011863673a353c334ddb2c93227dceadc5d7c3b6.tar.gz
rails-011863673a353c334ddb2c93227dceadc5d7c3b6.tar.bz2
rails-011863673a353c334ddb2c93227dceadc5d7c3b6.zip
Adds examples to FinderMethods#first [ci skip]
-rw-r--r--activerecord/lib/active_record/relation/finder_methods.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb
index 9d62e726d4..c1783dba72 100644
--- a/activerecord/lib/active_record/relation/finder_methods.rb
+++ b/activerecord/lib/active_record/relation/finder_methods.rb
@@ -87,6 +87,7 @@ module ActiveRecord
# 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