From f8079b815b41c5f7ecac736a232471f285fa0330 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Fri, 24 Oct 2008 17:59:45 +0530 Subject: Add some more info to the release notes --- railties/doc/guides/html/2_2_release_notes.html | 36 +++++++++++++++++++++++- railties/doc/guides/source/2_2_release_notes.txt | 19 +++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) (limited to 'railties/doc/guides') diff --git a/railties/doc/guides/html/2_2_release_notes.html b/railties/doc/guides/html/2_2_release_notes.html index c00165efb0..199a673a06 100644 --- a/railties/doc/guides/html/2_2_release_notes.html +++ b/railties/doc/guides/html/2_2_release_notes.html @@ -229,6 +229,8 @@ ul#navMain {
  • New Dynamic Finders
  • +
  • Associations Respect Private/Protected Scope
  • +
  • Other ActiveRecord Changes
  • @@ -502,6 +504,11 @@ More information :
    -

    5.5. Other ActiveRecord Changes

    +

    5.5. Associations Respect Private/Protected Scope

    +

    Active Record association proxies now respect the scope of methods on the proxied object. Previously (given User has_one :account) @user.account.private_method would call the private method on the associated Account object. That fails in Rails 2.2; if you need this functionality, you should use @user.account.send(:private_method) (or make the method public instead of private or protected). Please note that if you're overriding method_missing, you should also override respond_to to match the behavior in order for associations to function normally.

    +
    +

    5.6. Other ActiveRecord Changes

    +
    +
    +
    def partial_with_implicit_local_assignment
    +  @customer = Customer.new("Marcel")
    +  render :partial => "customer"
    +end
    +
    +

    Previously the above code made available a local variable called customer available inside the partial customer. You should explicitly pass all the variables via :locals hash now.

    +
      +
    • +

      country_select has been removed. See the deprecation page for more information and a plugin replacement.

    • diff --git a/railties/doc/guides/source/2_2_release_notes.txt b/railties/doc/guides/source/2_2_release_notes.txt index a73e79f6af..303d03548b 100644 --- a/railties/doc/guides/source/2_2_release_notes.txt +++ b/railties/doc/guides/source/2_2_release_notes.txt @@ -108,6 +108,7 @@ config.threadsafe! ------------------------------------------------------- * More information : + - link:http://m.onkey.org/2008/10/23/thread-safety-for-your-rails[Thread safety for your Rails] - link:http://weblog.rubyonrails.org/2008/8/16/josh-peek-officially-joins-the-rails-core[Thread safety project announcement] - link:http://blog.headius.com/2008/08/qa-what-thread-safe-rails-means.html[Q/A: What Thread-safe Rails Means] @@ -191,6 +192,12 @@ User.find_by_name!('Moby') * Lead Contributor: link:http://blog.hasmanythrough.com[Josh Susser] +=== Associations Respect Private/Protected Scope + +Active Record association proxies now respect the scope of methods on the proxied object. Previously (given User has_one :account) +@user.account.private_method+ would call the private method on the associated Account object. That fails in Rails 2.2; if you need this functionality, you should use +@user.account.send(:private_method)+ (or make the method public instead of private or protected). Please note that if you're overriding +method_missing+, you should also override +respond_to+ to match the behavior in order for associations to function normally. + +* Lead Contributor: Adam Milligan + === Other ActiveRecord Changes * +rake db:migrate:redo+ now accepts an optional VERSION to target that specific migration to redo @@ -384,6 +391,18 @@ A few pieces of older code are deprecated in this release: * +Rails::SecretKeyGenerator+ has been replaced by +ActiveSupport::SecureRandom+ * +render_component+ is deprecated. There's a link:http://github.com/rails/render_component/tree/master[render_components plugin] available if you need this functionality. +* Implicit local assignments when rendering partials has been deprecated. + +[source, ruby] +------------------------------------------------------- +def partial_with_implicit_local_assignment + @customer = Customer.new("Marcel") + render :partial => "customer" +end +------------------------------------------------------- + +Previously the above code made available a local variable called +customer+ available inside the partial 'customer'. You should explicitly pass all the variables via :locals hash now. + * +country_select+ has been removed. See the link:http://www.rubyonrails.org/deprecation/list-of-countries[deprecation page] for more information and a plugin replacement. * +ActiveRecord::Base.allow_concurrency+ no longer has any effect. * +ActiveRecord::Errors.default_error_messages+ has been deprecated in favor of +I18n.translate('activerecord.errors.messages')+ -- cgit v1.2.3