diff options
author | Mike Gunderloy <MikeG1@larkfarm.com> | 2009-02-27 08:30:51 -0600 |
---|---|---|
committer | Mike Gunderloy <MikeG1@larkfarm.com> | 2009-02-27 08:30:51 -0600 |
commit | d0877508cb2cc575145677c2935900449e577827 (patch) | |
tree | 56ecc7b19de5e1413db1acec34c69e633ef6a16f /railties/guides/source/2_3_release_notes.textile | |
parent | 9fda6c51402c13530cf9fffe7bc69db2e3488cb1 (diff) | |
download | rails-d0877508cb2cc575145677c2935900449e577827.tar.gz rails-d0877508cb2cc575145677c2935900449e577827.tar.bz2 rails-d0877508cb2cc575145677c2935900449e577827.zip |
Update release notes for 2.3 RC2
Diffstat (limited to 'railties/guides/source/2_3_release_notes.textile')
-rw-r--r-- | railties/guides/source/2_3_release_notes.textile | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/railties/guides/source/2_3_release_notes.textile b/railties/guides/source/2_3_release_notes.textile index 07af76dda8..051379c437 100644 --- a/railties/guides/source/2_3_release_notes.textile +++ b/railties/guides/source/2_3_release_notes.textile @@ -138,7 +138,7 @@ Customer.find_in_batches(:conditions => {:active => true}) do |customer_group| end </ruby> -You can pass most of the +find+ options into +find_in_batches+. However, you cannot specify the order that records will be returned in (they will always be returned in ascending order of primary key, which must be an integer), or use the +:limit+ option. Instead, use the +:batch_size: option, which defaults to 1000, to set the number of records that will be returned in each batch. +You can pass most of the +find+ options into +find_in_batches+. However, you cannot specify the order that records will be returned in (they will always be returned in ascending order of primary key, which must be an integer), or use the +:limit+ option. Instead, use the +:batch_size+ option, which defaults to 1000, to set the number of records that will be returned in each batch. The new +each+ method provides a wrapper around +find_in_batches+ that returns individual records, with the find itself being done in batches (of 1000 by default): @@ -148,7 +148,7 @@ Customer.each do |customer| end </ruby> -Note that you should only use this record for batch processing: for small numbers of records (less than 1000), you should just use the regular find methods with your own loop. +Note that you should only use this method for batch processing: for small numbers of records (less than 1000), you should just use the regular find methods with your own loop. * More Information: - "Rails 2.3: Batch Finding":http://afreshcup.com/2009/02/23/rails-23-batch-finding/ @@ -438,6 +438,18 @@ returns </optgroup> </ruby> +h4. A Note About Template Loading + +Rails 2.3 includes the ability to enable or disable cached templates for any particular environment. Cached templates give you a speed boost because they don't check for a new template file when they're rendered - but they also mean that you can't replace a template "on the fly" without restarting the server. + +In most cases, you'll want template caching to be turned on in production, which you can do by making a setting in your +production.rb+ file: + +<ruby> +config.action_view.cache_template_loading = true +</ruby> + +This line will be generated for you by default in a new Rails 2.3 application. But please note: if you've upgraded from an older version of Rails, you won't have this setting in your +production.rb+ and template caching will be off by default. Unless you really need the ability to update templates in production without restarting the server, you should be sure to add this setting when you upgrade. + h4. Other Action View Changes * Token generation for CSRF protection has been simplified; now Rails uses a simple random string generated by +ActiveSupport::SecureRandom+ rather than mucking around with session IDs. @@ -488,7 +500,7 @@ In addition to the Rack changes covered above, Railties (the core code of Rails h4. Rails Metal -Rails Metal is a new mechanism that provides superfast endpoints inside of your Rails applications. Metal classes bypass routing and Action Controller to give you raw speed (at the cost of all the things in Action Controller, of course). This builds on all of the recent foundation work to make Rails a Rack application with an exposed middleware stack. +Rails Metal is a new mechanism that provides superfast endpoints inside of your Rails applications. Metal classes bypass routing and Action Controller to give you raw speed (at the cost of all the things in Action Controller, of course). This builds on all of the recent foundation work to make Rails a Rack application with an exposed middleware stack. Metal endpoints can be loaded from your application or from plugins. * More Information: ** "Introducing Rails Metal":http://weblog.rubyonrails.org/2008/12/17/introducing-rails-metal |