aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorNoemj <olli.rissanen@helsinki.fi>2013-04-11 19:11:33 +0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-04-11 13:19:49 -0300
commitdab82332c8866b967d1189c14aa0edc0a9fd09ae (patch)
treeb11e6ea6763b2d7d700f5822c89c52d45b5d1581 /activerecord
parent53d6cc04e73d5e9a0ec334bdfdce8f272005564f (diff)
downloadrails-dab82332c8866b967d1189c14aa0edc0a9fd09ae.tar.gz
rails-dab82332c8866b967d1189c14aa0edc0a9fd09ae.tar.bz2
rails-dab82332c8866b967d1189c14aa0edc0a9fd09ae.zip
Switched to new naming conventions
[ci skip]
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG.md6
-rw-r--r--activerecord/lib/active_record/statement_cache.rb2
2 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index cf697d8b16..aa156f5d4f 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,13 +1,13 @@
## Rails 4.0.0 (unreleased) ##
* Added Statement Cache to allow the caching of a single statement. The cache works by
- duping the relation returned from yielding a statement which allows skipping the AST
- building phase.
+ duping the relation returned from yielding a statement, which allows skipping the AST
+ building phase for following executes. The cache returns results in array format.
Example:
cache = ActiveRecord::StatementCache.new do
- Book.where(:name => "my book").limit(100)
+ Book.where(name: "my book").limit(100)
end
books = cache.execute
diff --git a/activerecord/lib/active_record/statement_cache.rb b/activerecord/lib/active_record/statement_cache.rb
index 4a8c54414d..8c4b4f666b 100644
--- a/activerecord/lib/active_record/statement_cache.rb
+++ b/activerecord/lib/active_record/statement_cache.rb
@@ -4,7 +4,7 @@ module ActiveRecord
# Initializing the cache is done by passing the statement in the initialization block:
#
# cache = ActiveRecord::StatementCache.new do
- # Book.where(:name => "my book").limit(100)
+ # Book.where(name: "my book").limit(100)
# end
#
# The cached statement is executed by using the +execute+ method: