Ruby on Rails 刚刚发布了 2.3.6: 该版本包含六个月以来的 bug 修复,一小些新特性,以及一个到 Rails 3 的桥接。同时该版本废弃了一些无用的功能,而这些功能将于 Rails 3 中被删除。
详细的改进内容:
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
alertandnotice, the most common flash keys in many apps, toself.alert = '...'andself.notice = '...'. Addredirect_to url, :alert => '...'and:notice => '...'. Read more. - i18n: localize the
labelhelper.
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_andchange_columnsupport column positioning using:first => trueand: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_blankandassert_present. Read more. - Core: backport
Object#singleton_classfrom Ruby 1.8.8, deprecating ourObject#metaclass. - Core: add
Object#presencethat returns the object if it’s#present?otherwise returnsnil. Example:region = params[:state].presence || params[:country].presence || 'US' - Core: add
Enumerable#exclude?to matchinclude?. - Core: rename
Array#randtoArray#random_elementto avoid collision withKernel#rand. - Core: rename
Date#andTime#last_(month|year)to#prev_(month|year)for Ruby 1.9 forward compatibility.
Active Resource
- JSON: set
ActiveResource::Base.include_root_in_json = trueto 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.
详细内容请看 commit log
暂无更多评论