From 414b68df1fb602769f49414cae04bfba9712c4dc Mon Sep 17 00:00:00 2001 From: Damien Mathieu Date: Mon, 30 Aug 2010 15:08:55 +0200 Subject: fix the cache_fu links --- railties/guides/source/caching_with_rails.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides') diff --git a/railties/guides/source/caching_with_rails.textile b/railties/guides/source/caching_with_rails.textile index ff672d8695..818c6eb00e 100644 --- a/railties/guides/source/caching_with_rails.textile +++ b/railties/guides/source/caching_with_rails.textile @@ -364,7 +364,7 @@ end h3. Advanced Caching -Along with the built-in mechanisms outlined above, a number of excellent plugins exist to help with finer grained control over caching. These include Chris Wanstrath's excellent cache_fu plugin (more info "here": http://errtheblog.com/posts/57-kickin-ass-w-cachefu) and Evan Weaver's interlock plugin (more info "here": http://blog.evanweaver.com/articles/2007/12/13/better-rails-caching/). Both of these plugins play nice with memcached and are a must-see for anyone +Along with the built-in mechanisms outlined above, a number of excellent plugins exist to help with finer grained control over caching. These include Chris Wanstrath's excellent cache_fu plugin (more info "here":http://errtheblog.com/posts/57-kickin-ass-w-cachefu ) and Evan Weaver's interlock plugin (more info "here":http://blog.evanweaver.com/articles/2007/12/13/better-rails-caching/ ). Both of these plugins play nice with memcached and are a must-see for anyone seriously considering optimizing their caching needs. Also the new "Cache money":http://github.com/nkallen/cache-money/tree/master plugin is supposed to be mad cool. -- cgit v1.2.3 From 3d13dc88e20f86ac294baeafdd8343c5ddd3b623 Mon Sep 17 00:00:00 2001 From: Joost Baaij Date: Mon, 30 Aug 2010 21:03:07 +0200 Subject: refer to guides since 3.0 is released now --- railties/guides/source/initialization.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides') diff --git a/railties/guides/source/initialization.textile b/railties/guides/source/initialization.textile index 531ddd998b..c53071971a 100644 --- a/railties/guides/source/initialization.textile +++ b/railties/guides/source/initialization.textile @@ -1437,7 +1437,7 @@ Afterwards this includes the +ActiveSupport::Benchmarkable+ which is used for be end -The "documentation":http://api.rails.info/classes/ActiveSupport/Benchmarkable.html#M000607 is great about explaining what precisely this does. (TODO: replace link with real documentation link when it becomes available.) +The "documentation":http://api.rubyonrails.org/classes/ActiveSupport/Benchmarkable.html is great about explaining what precisely this does. This module is also included into Active Record and +AbstractController+, meaning you can also use the +benchmark+ method in these methods. -- cgit v1.2.3 From 15d07981f6617a3f97f9e36f257131b56a97a441 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Mon, 30 Aug 2010 21:08:54 +0200 Subject: Revert "refer to guides since 3.0 is released now" Reason: This is an exception. Thing is when you contribute to Rails you need to know how to proceed *now*, the instructions may be different than the ones published with some past release. This reverts commit 3d13dc88e20f86ac294baeafdd8343c5ddd3b623. --- railties/guides/source/initialization.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides') diff --git a/railties/guides/source/initialization.textile b/railties/guides/source/initialization.textile index c53071971a..531ddd998b 100644 --- a/railties/guides/source/initialization.textile +++ b/railties/guides/source/initialization.textile @@ -1437,7 +1437,7 @@ Afterwards this includes the +ActiveSupport::Benchmarkable+ which is used for be end -The "documentation":http://api.rubyonrails.org/classes/ActiveSupport/Benchmarkable.html is great about explaining what precisely this does. +The "documentation":http://api.rails.info/classes/ActiveSupport/Benchmarkable.html#M000607 is great about explaining what precisely this does. (TODO: replace link with real documentation link when it becomes available.) This module is also included into Active Record and +AbstractController+, meaning you can also use the +benchmark+ method in these methods. -- cgit v1.2.3 From e4c66d8fbfb7077f002462e82af2e3cb908089c4 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Mon, 30 Aug 2010 21:14:29 +0200 Subject: Revert "Revert "refer to guides since 3.0 is released now"" Wanted to revert a different commit with same message This reverts commit 15d07981f6617a3f97f9e36f257131b56a97a441. --- railties/guides/source/initialization.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides') diff --git a/railties/guides/source/initialization.textile b/railties/guides/source/initialization.textile index 531ddd998b..c53071971a 100644 --- a/railties/guides/source/initialization.textile +++ b/railties/guides/source/initialization.textile @@ -1437,7 +1437,7 @@ Afterwards this includes the +ActiveSupport::Benchmarkable+ which is used for be end -The "documentation":http://api.rails.info/classes/ActiveSupport/Benchmarkable.html#M000607 is great about explaining what precisely this does. (TODO: replace link with real documentation link when it becomes available.) +The "documentation":http://api.rubyonrails.org/classes/ActiveSupport/Benchmarkable.html is great about explaining what precisely this does. This module is also included into Active Record and +AbstractController+, meaning you can also use the +benchmark+ method in these methods. -- cgit v1.2.3 From 7803bb015de4c10278ac741ec404db652125f9bf Mon Sep 17 00:00:00 2001 From: Joost Baaij Date: Mon, 30 Aug 2010 21:16:53 +0200 Subject: Remove beta and RC paths in documentation --- railties/guides/source/3_0_release_notes.textile | 10 ++---- railties/guides/source/getting_started.textile | 3 +- railties/guides/source/initialization.textile | 44 ++++++++++++------------ 3 files changed, 26 insertions(+), 31 deletions(-) (limited to 'railties/guides') diff --git a/railties/guides/source/3_0_release_notes.textile b/railties/guides/source/3_0_release_notes.textile index 464fd66b7b..9c08c9fa0a 100644 --- a/railties/guides/source/3_0_release_notes.textile +++ b/railties/guides/source/3_0_release_notes.textile @@ -18,13 +18,11 @@ These release notes cover the major upgrades, but don't include every little bug endprologue. -WARNING: Rails 3.0 is currently in beta. This means that there are probably bugs and that you should "report them":http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/overview if you see them. You also may not want to run the NORAD nuclear launch application off a beta version. But if you're starting development on a new application and you don't mind getting wind in your hair, please do jump on board! - -To install the last Rails 3 beta: +To install Rails 3: # Use sudo if your setup requires it -gem install rails --pre +gem install rails @@ -77,10 +75,8 @@ More information - "The Path to Rails 3: Approaching the upgrade":http://omgblog h3. Creating a Rails 3.0 application -The new installing rails sequence (for the beta) is: - -$ gem install rails --prerelease +# You should have the 'rails' rubygem installed $ rails new myapp $ cd myapp diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile index 49c1049cc7..9ccf40fd37 100644 --- a/railties/guides/source/getting_started.textile +++ b/railties/guides/source/getting_started.textile @@ -149,8 +149,6 @@ Usually run this as the root user: # gem install rails -NOTE. In the Rails 3.0.0-beta, you will need to manually install the dependencies for Rails itself as a bug in rubygems will cause these to not be installed, see the "3.0 Release Notes":3_0_release_notes.html for the commands to run. - TIP. If you're working on Windows, you may find it easier to install "Instant Rails":http://instantrails.rubyforge.org/wiki/wiki.pl. Be aware, though, that Instant Rails releases tend to lag seriously behind the actual Rails version. Also, you will find that Rails development on Windows is overall less pleasant than on other operating systems. If at all possible, we suggest that you install a Linux virtual machine and use that for Rails development, instead of using Windows. h4. Creating the Blog Application @@ -1482,6 +1480,7 @@ h3. Changelog "Lighthouse ticket":http://rails.lighthouseapp.com/projects/16213-rails-guides/tickets/2 +* August 30, 2010: Minor editing after Rails 3 release by "Joost Baaij":http://www.spacebabies.nl * July 12, 2010: Fixes, editing and updating of code samples by "Jaime Iniesta":http://jaimeiniesta.com * May 16, 2010: Added a section on configuration gotchas to address common encoding problems that people might have by "Yehuda Katz":http://www.yehudakatz.com * April 30, 2010: Fixes, editing and updating of code samples by "Rohit Arondekar":http://rohitarondekar.com diff --git a/railties/guides/source/initialization.textile b/railties/guides/source/initialization.textile index c53071971a..486142ea4b 100644 --- a/railties/guides/source/initialization.textile +++ b/railties/guides/source/initialization.textile @@ -103,7 +103,7 @@ Now with Rails 3 we have a Gemfile which defines the basics our application need source 'http://rubygems.org' - gem 'rails', '3.0.0.beta4' + gem 'rails', '3.0.0' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' @@ -133,12 +133,12 @@ Now with Rails 3 we have a Gemfile which defines the basics our application need Here the only two gems we need are +rails+ and +sqlite3-ruby+, so it seems. This is until you run +bundle pack+. This command freezes all the gems required by your application into _vendor/cache_. The gems installed by default are: * abstract-1.0.0.gem -* actionmailer-3.0.0.beta4.gem -* actionpack-3.0.0.beta4.gem -* activemodel-3.0.0.beta4.gem -* activerecord-3.0.0.beta4.gem -* activeresource-3.0.0.beta4.gem -* activesupport-3.0.0.beta4.gem +* actionmailer-3.0.0.gem +* actionpack-3.0.0.gem +* activemodel-3.0.0.gem +* activerecord-3.0.0.gem +* activeresource-3.0.0.gem +* activesupport-3.0.0.gem * arel-0.4.0.gem * builder-2.1.2.gem * bundler-1.0.0.rc.2.gem @@ -152,8 +152,8 @@ Here the only two gems we need are +rails+ and +sqlite3-ruby+, so it seems. This * rack-1.2.1.gem * rack-mount-0.6.12.gem * rack-test-0.5.4.gem -* rails-3.0.0.beta4.gem -* railties-3.0.0.beta4.gem +* rails-3.0.0.gem +* railties-3.0.0.gem * rake-0.8.7.gem * sqlite3-ruby-1.3.1.gem * text-format-1.0.0.gem @@ -1374,8 +1374,8 @@ the _version_ file contains this code (comments stripped): module ActionPack #:nodoc: module VERSION #:nodoc: MAJOR = 3 - MINOR = 1 - TINY = "0.beta1" + MINOR = 0 + TINY = 0 STRING = [MAJOR, MINOR, TINY].join('.') end @@ -2250,18 +2250,18 @@ The method +find_with_root_flag+ is defined on +Rails::Engine+ (the superclass o +called_from+ goes through the +caller+ which is the stacktrace of the current thread, in the case of your application it would go a little like this:
-  /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0.beta1/lib/rails/application.rb:30:in `inherited'
+  /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0/lib/rails/application.rb:30:in `inherited'
   /home/you/yourapp/config/application.rb:4:in `'
   /home/you/yourapp/config/application.rb:3:in `'
-  /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.beta1/lib/active_support/dependencies.rb:167:in `require'
-  /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.beta1/lib/active_support/dependencies.rb:167:in `block in require'
-  /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.beta1/lib/active_support/dependencies.rb:537:in `new_constants_in'
-  /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.beta1/lib/active_support/dependencies.rb:167:in `require'
-  /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0.beta1/lib/rails/commands.rb:33:in `'
-  /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.beta1/lib/active_support/dependencies.rb:167:in `require'
-  /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.beta1/lib/active_support/dependencies.rb:167:in `block in require'
-  /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.beta1/lib/active_support/dependencies.rb:537:in `new_constants_in'
-  /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.beta1/lib/active_support/dependencies.rb:167:in `require'
+  /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:167:in `require'
+  /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:167:in `block in require'
+  /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:537:in `new_constants_in'
+  /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:167:in `require'
+  /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0/lib/rails/commands.rb:33:in `'
+  /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:167:in `require'
+  /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:167:in `block in require'
+  /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:537:in `new_constants_in'
+  /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:167:in `require'
   /var/www/rboard/script/rails:10:in `
'
@@ -2274,7 +2274,7 @@ The method +find_with_root_flag+ is defined on +Rails::Engine+ (the superclass o end
-The +call_stack+ here is the +caller+ output shown previously, minus everything after the first +:+ on all the lines. The first path that matches this is _/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0.beta1/lib/rails_. Yours may vary slightly, but should always end in _railties-x.x.x/lib/rails_. +The +call_stack+ here is the +caller+ output shown previously, minus everything after the first +:+ on all the lines. The first path that matches this is _/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0/lib/rails_. Yours may vary slightly, but should always end in _railties-x.x.x/lib/rails_. The code in +find_root_with_flag+ will go up this directory structure until it reaches the top, which in this case is +/+. -- cgit v1.2.3 From 19d99971f77d3df0b4d1dbfef195559f631cf179 Mon Sep 17 00:00:00 2001 From: Joost Baaij Date: Mon, 30 Aug 2010 21:31:42 +0200 Subject: Remove mention of InstantRails, it is completely obsolete. Mention RubyInstaller instead which is actually quite pleasant and runs Rails fine. --- railties/guides/source/getting_started.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides') diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile index 9ccf40fd37..92b9131b59 100644 --- a/railties/guides/source/getting_started.textile +++ b/railties/guides/source/getting_started.textile @@ -149,7 +149,7 @@ Usually run this as the root user: # gem install rails -TIP. If you're working on Windows, you may find it easier to install "Instant Rails":http://instantrails.rubyforge.org/wiki/wiki.pl. Be aware, though, that Instant Rails releases tend to lag seriously behind the actual Rails version. Also, you will find that Rails development on Windows is overall less pleasant than on other operating systems. If at all possible, we suggest that you install a Linux virtual machine and use that for Rails development, instead of using Windows. +TIP. If you're working on Windows, you should be aware that the vast majority of Rails development is done in Unix environments. While Ruby and Rails themselves install easily using for example "Ruby Installer":http://rubyinstaller.org/, the supporting ecosystem often assumes you are able to build C-based rubygems and work in a command window. If at all possible, we suggest that you install a Linux virtual machine and use that for Rails development, instead of using Windows. h4. Creating the Blog Application -- cgit v1.2.3 From c30f6c270da5cd2ad7605ee9255f052e93609e30 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Mon, 30 Aug 2010 23:05:14 +0100 Subject: User.each is a lie --- railties/guides/source/active_record_querying.textile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'railties/guides') diff --git a/railties/guides/source/active_record_querying.textile b/railties/guides/source/active_record_querying.textile index b54b5c116b..178a5c50bf 100644 --- a/railties/guides/source/active_record_querying.textile +++ b/railties/guides/source/active_record_querying.textile @@ -159,14 +159,14 @@ The following may seem very straight forward at first: # Very inefficient when users table has thousands of rows. -User.each do |user| +User.all.each do |user| NewsLetter.weekly_deliver(user) end But if the total number of rows in the table is very large, the above approach may vary from being under performant to just plain impossible. -This is because +User.each+ makes Active Record fetch _the entire table_, build a model object per row, and keep the entire array in the memory. Sometimes that is just too many objects and demands too much memory. +This is because +User.all.each+ makes Active Record fetch _the entire table_, build a model object per row, and keep the entire array in the memory. Sometimes that is just too many objects and demands too much memory. h5. +find_each+ -- cgit v1.2.3