Ruby on Rails 2.3.6 Released

Posted by Jeremy Kemper May 23, 2010 @ 07:56 AM

We’ve released Ruby on Rails 2.3.6: six months of bug fixes, a handful of new features, and a strong bridge to Rails 3.

We deprecated some obscure and ancient features in Rails 2.3.6 so we could cut them entirely from Rails 3. If your app runs on Rails 2.3.6 without deprecation warnings, you’re in good shape for a smooth sail onward.

This slow-cooked dish is brought to you some 87 committers from our all-volunteer kitchen.

Now, let’s open the goodie bag!

Action Pack

  • Upgrade Rack from 1.0.1 to 1.1.0.
  • XSS prevention: update to match Rails 3 and move to the official plugin at http://github.com/rails/rails_xss.
  • Cookies: convenient cookie jar add-ons to set permanent or signed cookies, or both at once: cookies.permanent.signed[:remember_me] = current_user.id. Read more.
  • Flash: promote alert and notice, the most common flash keys in many apps, to self.alert = '...' and self.notice = '...'. Add redirect_to url, :alert => '...' and :notice => '...'. Read more.
  • i18n: localize the label helper.

Active Record

  • Namespacing: support optional table name prefixes on modules by defining self.table_name_prefix. Read more.
  • Destroy uses optimistic locking.
  • Counter cache: use Post.reset_counters(1234, :comments) to count the number of comments for post 1234 and reset its comments_count cache.
  • PostgreSQL: always use standard-conforming strings, if supported.
  • MySQL: add index length support. Read more.
  • MySQL: add_ and change_column support column positioning using :first => true and :after => :other_column.

Active Support

  • Upgrade i18n from 1.3.3 to 1.3.7.
  • Upgrade TZInfo from 0.3.12 to 0.3.16.
  • Multibyte: speed up string verification and cleaning.
  • JSON: use YAJL for JSON decoding, if available. gem install yajl-ruby
  • Testing: add assert_blank and assert_present. Read more.
  • Core: backport Object#singleton_class from Ruby 1.8.8, deprecating our Object#metaclass.
  • Core: add Object#presence that returns the object if it’s #present? otherwise returns nil. Example: region = params[:state].presence || params[:country].presence || 'US'
  • Core: add Enumerable#exclude? to match include?.
  • Core: rename Array#rand to Array#random_element to avoid collision with Kernel#rand.
  • Core: rename Date# and Time#last_(month|year) to #prev_(month|year) for Ruby 1.9 forward compatibility.

Active Resource

  • JSON: set ActiveResource::Base.include_root_in_json = true to serialize as a hash of model name -> attributes instead of a bare attributes hash. Defaults to false.

Action Mailer

  • Upgrade TMail from 1.2.3 to 1.2.7.

Railties

  • Silence RubyGems 1.3.6 deprecation warnings.

Peruse the commit log for the full story.

Posted in Releases | 30 comments

Comments

  1. Sleeptillseven on 23 May 08:14:

    Great job. Looking forward to version 3.

  2. Ryan O on 23 May 08:14:

    Awesome.. Some cool updates! Thanks

  3. Pavlo Zahozhenko on 23 May 08:24:

    Good work! Updating my dev app to try out some of the new features..

  4. Mark Mansour on 23 May 08:25:

    Thanks for all the hard work guys and I love the idea of easing the transition to rails 3.

  5. sesharim on 23 May 08:28:

    yahoo!:)

  6. Ryan Bigg on 23 May 08:42:

    Thanks to all for their work on this! Bring on 3.0!

  7. Ynw on 23 May 09:12:

    Json stuff are much welcome.

  8. Jones on 23 May 09:40:

    Mama mia!

  9. keikun17 on 23 May 09:45:

    ActiveResource::Base.include_root_in_json = true to serialize as a hash of model name -> attributes instead of a bare attributes hash. Defaults to false.

    Allahu akbar! that’s another couple of lines off my controller

  10. nacho on 23 May 09:56:

    great!

    new macbook pro and new rails at the same time for me ;-)

    thanks.

  11. glebm on 23 May 09:58:

    Thanks for TMail upgrade :)

  12. Dmitry Plashchynski on 23 May 10:05:

    Great job guys!

  13. Michael on 23 May 10:05:

    How to disable the RailsXss Plugin?

  14. Travis Warlick on 23 May 10:50:

    Greay work on this, and thanks to all who contributed.

    That said, this is piss-poor versioning. Way too many changes. Should be 2.4.0.

  15. Hendra Nicholas on 23 May 12:42:

    Prikittiiiw…. Great job guys! I’m Looking forward to rails 3.

  16. Jan on 23 May 13:23:

    Great stuff!

  17. Bradley Holton on 23 May 14:18:

    This site is extremely informative and has proved to be handy. Full of information and productive articles.

    Regards, Bradley Holton.

  18. Alexander Mankuta on 23 May 16:49:

    Jeremy, why does rails bundle TZInfo, TMail and other libs available as gems?

    PS: Congratulations with new release.

  19. Stefan Kroes on 23 May 16:56:

    Yeah! Thanks everyone!

  20. L61ronny on 23 May 19:00:

    Thank you so much for all the work that went into this release.

  21. NS on 23 May 19:06:

    I updated a 2.3.5 app to 2.3.5 by gem update rails and changed the version # in environment.rb to 2.3.6. Then I went into the console and did Model.all, and I get:

    NoMethodError: undefined method `retrieve_connection’ for nil:NilClass from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.6/lib/active_support/whiny_nil.rb:52:in `method_missing’ from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retr ieve_connection’ from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `conn ection’ from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.6/lib/active_record/base.rb:3154:in `quoted_table_name’ from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.6/lib/active_record/base.rb:1714:in `construct_finder_sql’ from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.6/lib/active_record/base.rb:1578:in `find_every’ from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.6/lib/active_record/base.rb:618:in `find’ from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.6/lib/active_record/base.rb:638:in `all’ from (irb):1

    What do you think this might be?

    Thanks!

  22. Tony Ja on 24 May 02:51:

    Does this release fix the issue where rails gem forget to install rack?

  23. Alex Soulim on 24 May 05:44:

    Thank you guys!

  24. EV on 24 May 06:23:

    Great news!

    Now, don’t take it personally, but the next time, please, avoid 20MB of cruft in test/tmp/ in actionpack.

  25. claudio on 24 May 07:30:

    Great job! I’ll try to update my rails projects soon

  26. Ian on 24 May 09:56:

    Any chance that you’ll repack the ActionPack 2.3.6 gems to not contain 500+ RackMultipart* temporary files in test/tmp? Makes bundling the gem into SVN rather annoying, as it’s clocking in at 17MB in size.

  27. Ian on 24 May 10:08:

    Ah, I see you’ve fixed it now with 2.3.7… nice one!

  28. Srijith on 24 May 16:44:

    Excellent job and very much exited to see Rocking-rails3.0

  29. Tim on 26 May 13:24:

    Thanks for all your hard work.

    I love that i18n now localizes the label helper. Saves a good bit of typing :)

  30. ehiqiq on 19 Jun 16:39:

    Thanx :)