aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorOscar Del Ben <info@oscardelben.com>2012-04-28 11:45:15 +0200
committerOscar Del Ben <info@oscardelben.com>2012-04-28 11:45:15 +0200
commit4e69a1579ea74fe2823f6fb2f055db97480492e5 (patch)
treed8a5834a0ed5a372969f26db753a30785777a5c2 /guides
parent943410197cca4235212ca0fc409820378a40890c (diff)
parent0297e8e4ddc034bcb8ed477efff91d8fe104cb39 (diff)
downloadrails-4e69a1579ea74fe2823f6fb2f055db97480492e5.tar.gz
rails-4e69a1579ea74fe2823f6fb2f055db97480492e5.tar.bz2
rails-4e69a1579ea74fe2823f6fb2f055db97480492e5.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'guides')
-rw-r--r--guides/source/active_record_querying.textile2
-rw-r--r--guides/source/configuring.textile3
-rw-r--r--guides/source/contributing_to_ruby_on_rails.textile13
-rw-r--r--guides/source/routing.textile18
4 files changed, 34 insertions, 2 deletions
diff --git a/guides/source/active_record_querying.textile b/guides/source/active_record_querying.textile
index 98937266ba..a0517eea1d 100644
--- a/guides/source/active_record_querying.textile
+++ b/guides/source/active_record_querying.textile
@@ -926,7 +926,7 @@ This code looks fine at the first sight. But the problem lies within the total n
Active Record lets you specify in advance all the associations that are going to be loaded. This is possible by specifying the +includes+ method of the +Model.find+ call. With +includes+, Active Record ensures that all of the specified associations are loaded using the minimum possible number of queries.
-Revisiting the above case, we could rewrite +Client.all+ to use eager load addresses:
+Revisiting the above case, we could rewrite +Client.limit(10)+ to use eager load addresses:
<ruby>
clients = Client.includes(:address).limit(10)
diff --git a/guides/source/configuring.textile b/guides/source/configuring.textile
index 1541428af9..28c138c714 100644
--- a/guides/source/configuring.textile
+++ b/guides/source/configuring.textile
@@ -525,7 +525,8 @@ development:
password:
</yaml>
-If you use external connection pool manager, you can disable prepared statements in rails:
+Prepared Statements can be disabled thus:
+
<yaml>
production:
adapter: postgresql
diff --git a/guides/source/contributing_to_ruby_on_rails.textile b/guides/source/contributing_to_ruby_on_rails.textile
index fbb3483dae..ddb7175e03 100644
--- a/guides/source/contributing_to_ruby_on_rails.textile
+++ b/guides/source/contributing_to_ruby_on_rails.textile
@@ -105,6 +105,13 @@ $ cd railties
$ TEST_DIR=generators bundle exec rake test
</shell>
+You can run any single test separately too:
+
+<shell>
+$ cd actionpack
+$ ruby -Itest test/template/form_helper_test.rb
+</shell>
+
h4. Warnings
The test suite runs with warnings enabled. Ideally, Ruby on Rails should issue no warnings, but there may be a few, as well as some from third-party libraries. Please ignore (or fix!) them, if any, and submit patches that do not issue new warnings.
@@ -201,6 +208,12 @@ $ bundle exec rake test
will now run the four of them in turn.
+You can also run any single test separately:
+
+<shell>
+$ ARRCONN=sqlite3 ruby -Itest test/cases/associations/has_many_associations_test.rb
+</shell>
+
You can invoke +test_jdbcmysql+, +test_jdbcsqlite3+ or +test_jdbcpostgresql+ also. See the file +activerecord/RUNNING_UNIT_TESTS+ for information on running more targeted database tests, or the file +ci/travis.rb+ for the test suite run by the continuous integration server.
h4. Older Versions of Ruby on Rails
diff --git a/guides/source/routing.textile b/guides/source/routing.textile
index 5e1cc042dc..836e0cdd70 100644
--- a/guides/source/routing.textile
+++ b/guides/source/routing.textile
@@ -829,6 +829,24 @@ end
This will create routing helpers such as +magazine_periodical_ads_url+ and +edit_magazine_periodical_ad_path+.
+h3. Breaking Up a Large Route File
+
+If you have a large route file that you would like to break up into multiple files, you can use the +#draw+ method in your router:
+
+<ruby>
+draw :admin
+</ruby>
+
+Then, create a file called +config/routes/admin.rb+. Name the file the same as the symbol passed to the +draw+ method). You can then use the normal routing DSL inside that file:
+
+<ruby>
+# in config/routes/admin.rb
+
+namespace :admin do
+ resources :posts
+end
+</ruby>
+
h3. Inspecting and Testing Routes
Rails offers facilities for inspecting and testing your routes.