今天把一个程序切换到edge rails(revision=6688),发现了以下变化:
1. 需要安装 libopenssl-ruby,否则会有
`const_missing': uninitialized constant ActionController::Base::DEPRECATED_INSTANCE_VARIABLES (NameError)
2. URL中的" ; " 变成了“/”
assert_select "a[href=/pages/#{page.id};edit]"
要改为
assert_select "a[href=/pages/#{page.id}/edit]"
3. AR默认对主键缓存对象实例
在1.2中
ticket = Ticket.find(params[:id])
ticket2 = Ticket.find(params[:id])
ticket.update_attributes(params[:ticket])
ticket.name.should != ticket2.name
在edge rails中
ticket = Ticket.find(params[:id])
ticket2 = Ticket.find(params[:id])
ticket.update_attributes(params[:ticket])
ticket.name.should == ticket2.name
这个变化不用说也清楚,Rails 2.0对性能高度重视。
4. Application::helper_method 不见了
restful_authentication生成的代码中
base.send :helper_method, :current_user, :logged_in?
会出错,因为找不到helper_method。