From e720b50fb1ff841970b2f1198996144c35b48461 Mon Sep 17 00:00:00 2001 From: Dmitry Polushkin Date: Mon, 10 Jun 2013 14:38:32 +0200 Subject: rename method `find_first_records` to `find_first_with_limit` --- activerecord/lib/active_record/relation/finder_methods.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index cf71df8fba..f240d0aaa9 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -81,7 +81,7 @@ module ActiveRecord # Person.first(3) # returns the first three objects fetched by SELECT * FROM people LIMIT 3 def first(limit = nil) if limit - find_first_records(order_values, limit) + find_first_with_limit(order_values, limit) else find_first end @@ -303,11 +303,11 @@ module ActiveRecord if loaded? @records.first else - @first ||= find_first_records(with_default_scope.order_values, 1).first + @first ||= find_first_with_limit(with_default_scope.order_values, 1).first end end - def find_first_records(order_values, limit) + def find_first_with_limit(order_values, limit) if order_values.empty? && primary_key order(arel_table[primary_key].asc).limit(limit).to_a else -- cgit v1.2.3