From 6acebb38bc0637bc05c19d87f8767f16ce79189b Mon Sep 17 00:00:00 2001 From: Jose and Yehuda Date: Wed, 25 Apr 2012 16:06:20 -0500 Subject: Allow loading external route files from the router This feature enables the ability to load an external routes file from the router via: draw :filename External routes files go in +config/routes+. This feature works in both engines and applications. --- guides/source/routing.textile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'guides') 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: + + +draw :admin + + +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: + + +# in config/routes/admin.rb + +namespace :admin do + resources :posts +end + + h3. Inspecting and Testing Routes Rails offers facilities for inspecting and testing your routes. -- cgit v1.2.3 From 50b1399b3128fcba73bf3478e22d187090921872 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Sat, 28 Apr 2012 00:36:14 +0530 Subject: update docs - disabling prepared statements is not connected to managing connections externally [ci skip] --- guides/source/configuring.textile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'guides') 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: -If you use external connection pool manager, you can disable prepared statements in rails: +Prepared Statements can be disabled thus: + production: adapter: postgresql -- cgit v1.2.3 From 7e75dcbff30657f395da9769b34ff252b7485e03 Mon Sep 17 00:00:00 2001 From: Alexey Vakhov Date: Sat, 28 Apr 2012 09:17:10 +0400 Subject: Update contributing guide - run single test --- guides/source/contributing_to_ruby_on_rails.textile | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'guides') diff --git a/guides/source/contributing_to_ruby_on_rails.textile b/guides/source/contributing_to_ruby_on_rails.textile index fbb3483dae..5f33336fdf 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 +You can run any single test separately too: + + +$ cd actionpack +$ ruby -Itest test/template/form_helper_test.rb + + 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. -- cgit v1.2.3 From dab6c3aa484778b44c1b3cd2b9c46363916295ff Mon Sep 17 00:00:00 2001 From: Alexey Vakhov Date: Sat, 28 Apr 2012 09:30:30 +0400 Subject: Update guides - run single test for AR testing --- guides/source/contributing_to_ruby_on_rails.textile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'guides') diff --git a/guides/source/contributing_to_ruby_on_rails.textile b/guides/source/contributing_to_ruby_on_rails.textile index 5f33336fdf..ddb7175e03 100644 --- a/guides/source/contributing_to_ruby_on_rails.textile +++ b/guides/source/contributing_to_ruby_on_rails.textile @@ -208,6 +208,12 @@ $ bundle exec rake test will now run the four of them in turn. +You can also run any single test separately: + + +$ ARRCONN=sqlite3 ruby -Itest test/cases/associations/has_many_associations_test.rb + + 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 -- cgit v1.2.3 From 0297e8e4ddc034bcb8ed477efff91d8fe104cb39 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 28 Apr 2012 11:29:11 +0200 Subject: Correct small consistency issue in AR querying guide --- guides/source/active_record_querying.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') 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: clients = Client.includes(:address).limit(10) -- cgit v1.2.3