mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Refactor && simplify count_records.
This commit is contained in:
committed by
Aaron Patterson
parent
e2bad8a2e7
commit
9f35799221
@@ -42,11 +42,7 @@ module ActiveRecord
|
||||
# documented side-effect of the method that may avoid an extra SELECT.
|
||||
@target ||= [] and loaded if count == 0
|
||||
|
||||
if @reflection.options[:limit]
|
||||
count = [ @reflection.options[:limit], count ].min
|
||||
end
|
||||
|
||||
count
|
||||
@reflection.options[:limit] ? [@reflection.options[:limit], count].min : count
|
||||
end
|
||||
|
||||
def has_cached_counter?
|
||||
|
||||
Reference in New Issue
Block a user