aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAbdelkader Boudih <terminale@gmail.com>2015-03-27 11:38:09 +0000
committerAbdelkader Boudih <terminale@gmail.com>2015-03-27 11:38:09 +0000
commit69283ab70a977787fc16830b194f1e25828a7ad8 (patch)
tree2753de3c0a6825621278363e37872cc18ff68ce3 /activerecord
parent3f28378cbde3528225d717c1bb1dcbdb9d093b34 (diff)
parentfe6de0f023ba2632cb2c0ee3e85b59b0eb1b353a (diff)
downloadrails-69283ab70a977787fc16830b194f1e25828a7ad8.tar.gz
rails-69283ab70a977787fc16830b194f1e25828a7ad8.tar.bz2
rails-69283ab70a977787fc16830b194f1e25828a7ad8.zip
Merge pull request #19547 from jonatack/warn-on-loading-large-query-sets
[skip ci] Improve `warn_on_records_fetched` code documentation
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/core.rb8
-rw-r--r--activerecord/lib/active_record/relation/record_fetch_warning.rb5
2 files changed, 6 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb
index a17eb226f4..09d7ac374a 100644
--- a/activerecord/lib/active_record/core.rb
+++ b/activerecord/lib/active_record/core.rb
@@ -96,10 +96,10 @@ module ActiveRecord
##
# :singleton-method:
- # Specify a threshold for the size of query result sets. If the
- # number of records in the set exceeds threshold, a warning is
- # logged. This should be used to identify queries which pull
- # thousands of records, which may cause memory bloat.
+ # Specify a threshold for the size of query result sets. If the number of
+ # records in the set exceeds the threshold, a warning is logged. This can
+ # be used to identify queries which load thousands of records and
+ # potentially cause memory bloat.
mattr_accessor :warn_on_records_fetched_greater_than, instance_writer: false
self.warn_on_records_fetched_greater_than = nil
diff --git a/activerecord/lib/active_record/relation/record_fetch_warning.rb b/activerecord/lib/active_record/relation/record_fetch_warning.rb
index 0d31f73ddd..14e1bf89fa 100644
--- a/activerecord/lib/active_record/relation/record_fetch_warning.rb
+++ b/activerecord/lib/active_record/relation/record_fetch_warning.rb
@@ -5,9 +5,8 @@ module ActiveRecord
# `config.active_record.warn_on_records_fetched_greater_than` is
# set to an integer, if the number of records a query returns is
# greater than the value of `warn_on_records_fetched_greater_than`,
- # a warning is logged. This allows for the dection of queries that
- # return a large number of records, which could cause memory
- # bloat.
+ # a warning is logged. This allows for the detection of queries that
+ # return a large number of records, which could cause memory bloat.
#
# In most cases, fetching large number of records can be performed
# efficiently using the ActiveRecord::Batches methods.