From 70ad12a72fe3151fd548e9a37a84b54060fcdbba Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Tue, 29 May 2012 21:26:04 +0200 Subject: [PATCH] copy edits the upgrading guide --- guides/source/upgrading_ruby_on_rails.textile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/guides/source/upgrading_ruby_on_rails.textile b/guides/source/upgrading_ruby_on_rails.textile index 63011d263d..6cdc6ab289 100644 --- a/guides/source/upgrading_ruby_on_rails.textile +++ b/guides/source/upgrading_ruby_on_rails.textile @@ -34,23 +34,23 @@ h4(#plugins4_0). vendor/plugins Rails 4.0 no longer supports loading plugins from vendor/plugins. You must replace any plugins by extracting them to gems and adding them to your Gemfile. If you choose not to make them gems, you can move them into, say, lib/my_plugin/* and add an appropriate initializer in config/initializers/my_plugin.rb. -h4(#identity_map4_0). IdentityMap +h4(#identity_map4_0). Identity Map -Rails 4.0 has removed IdentityMap from ActiveRecord, due to "some inconsistencies with associations":https://github.com/rails/rails/commit/302c912bf6bcd0fa200d964ec2dc4a44abe328a6. If you have manually enabled it in your application, you will have to remove the following config that has no effect anymore: config.active_record.identity_map. +Rails 4.0 has removed the identity map from Active Record, due to "some inconsistencies with associations":https://github.com/rails/rails/commit/302c912bf6bcd0fa200d964ec2dc4a44abe328a6. If you have manually enabled it in your application, you will have to remove the following config that has no effect anymore: config.active_record.identity_map. -h4(#active_record4_0). ActiveRecord +h4(#active_record4_0). Active Record -The delete method in collection associations can now receive Fixnum or String arguments as record ids, besides ActiveRecord objects, pretty much like the destroy method does. Previously it raised ActiveRecord::AssociationTypeMismatch for such arguments, from Rails 4.0 on it'll automatically try to find the records matching the given record ids before deleting them. +The delete method in collection associations can now receive Fixnum or String arguments as record ids, besides records, pretty much like the destroy method does. Previously it raised ActiveRecord::AssociationTypeMismatch for such arguments. From Rails 4.0 on delete automatically tries to find the records matching the given ids before deleting them. -h4(#active_model4_0). ActiveModel +h4(#active_model4_0). Active Model -Rails 4.0 has changed how errors attach with the ConfirmationValidator. Now when confirmation validations fail the error will be attached to :#{attribute}_confirmation instead of attribute. +Rails 4.0 has changed how errors attach with the ActiveModel::Validations::ConfirmationValidator. Now when confirmation validations fail the error will be attached to :#{attribute}_confirmation instead of attribute. -h4(#action_pack4_0). ActionPack +h4(#action_pack4_0). Action Pack -Rails 4.0 changed how assert_generates, assert_recognizes, and assert_routing work. Now all these assertions raise Assertion instead of RoutingError. +Rails 4.0 changed how assert_generates, assert_recognizes, and assert_routing work. Now all these assertions raise Assertion instead of ActionController::RoutingError. -h4(#helpers_order). Helpers loading order +h4(#helpers_order). Helpers Loading Order The loading order of helpers from more than one directory has changed in Rails 4.0. Previously, helpers from all directories were gathered and then sorted alphabetically. After upgrade to Rails 4.0 helpers will preserve the order of loaded directories and will be sorted alphabetically only within each directory. Unless you explicitly use helpers_path parameter, this change will only impact the way of loading helpers from engines. If you rely on the fact that particular helper from engine loads before or after another helper from application or another engine, you should check if correct methods are available after upgrade. If you would like to change order in which engines are loaded, you can use config.railties_order= method.