From 062d1f718943925debd3c4aae45a4b5e15b40632 Mon Sep 17 00:00:00 2001 From: Francesco Rodriguez Date: Thu, 11 Apr 2013 12:33:36 -0500 Subject: Fix StatementCache docs format [ci skip] --- activerecord/lib/active_record/statement_cache.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'activerecord/lib/active_record/statement_cache.rb') diff --git a/activerecord/lib/active_record/statement_cache.rb b/activerecord/lib/active_record/statement_cache.rb index 8c4b4f666b..731871d643 100644 --- a/activerecord/lib/active_record/statement_cache.rb +++ b/activerecord/lib/active_record/statement_cache.rb @@ -3,15 +3,15 @@ module ActiveRecord # Statement cache is used to cache a single statement in order to avoid creating the AST again. # 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) - # end + # cache = ActiveRecord::StatementCache.new do + # Book.where(name: "my book").limit(100) + # end # # The cached statement is executed by using the +execute+ method: # - # cache.execute + # cache.execute # - # The relation returned by yield is cached, and for each +execute+ call the cached relation gets duped. + # The relation returned by +yield+ is cached, and for each +execute+ call the cached relation gets duped. # Database is queried when +to_a+ is called on the relation. class StatementCache def initialize -- cgit v1.2.3 From 87735d3a281bcb1eb968855678dce6a0e7d7f677 Mon Sep 17 00:00:00 2001 From: Francesco Rodriguez Date: Fri, 12 Apr 2013 00:16:49 -0500 Subject: minor edit on StatementCache documentation [ci skip] --- activerecord/lib/active_record/statement_cache.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/statement_cache.rb') diff --git a/activerecord/lib/active_record/statement_cache.rb b/activerecord/lib/active_record/statement_cache.rb index 731871d643..dd4ee0c4a0 100644 --- a/activerecord/lib/active_record/statement_cache.rb +++ b/activerecord/lib/active_record/statement_cache.rb @@ -11,7 +11,7 @@ module ActiveRecord # # cache.execute # - # The relation returned by +yield+ is cached, and for each +execute+ call the cached relation gets duped. + # The relation returned by the block is cached, and for each +execute+ call the cached relation gets duped. # Database is queried when +to_a+ is called on the relation. class StatementCache def initialize -- cgit v1.2.3