Rails2.1新特性之ActiveRecord::Base.create的变化
ActiveRecord::Base.create 现在可以像 ActiveRecord::Base.new 一样带上一个代码块参数了。
@person = Person.create(params[:person]) do |p|
p.name = ‘Konata Izumi’
p.age = 17
end
This entry was posted on 星期一, 05月 12th, 2008 at 11:45 pm and is filed under something. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Have your say
You must be logged in to post a comment.