ITeye博客

2011 年文章归档

共 23 篇文章

Rails 3 ActiveRecord的Relation源码剖析

Rails3的一大亮点是 AR的query 接口: 1. 程序员最爱用就是它的及接方式 Uers.where().where().order().... 2. 还有LasyLoad可以增加灵活性 ================= 但这个Relation还是很让人迷惑的。尤其是一上来: delegate :find, :first, :last, :all, :destroy, :destroy_all, :exists?, :delete, :delete_all, :update, :update_all, :to => :scoped delegate :find_each, :fin…

2011-03-01 21:06

rails 3.0以上不能在netbean下调试的解决方法

netbean 6.9.1 在rails 3用 rdebug-ide 19但依然用 script/server去启动rails项目。实际上都用rails s了。 最好的解决方法是改rdebug-ide ruby-1.9.2-p136/gems/ruby-debug-ide19-0.4.12/bin/rdebug-ide:79行 #!fix netbean can not debug problem!# # save script name #Debugger::PROG_SCRIPT = ARGV.shift script = ARGV.shift Debugger::PROG_SCRIPT…

2011-02-13 12:49

rails 原码分析,理顺则好用

一直专业写rails程序,很多东西也没有理清,不通则不快。趁过年前有时间,剖析一下!系统化程度越高,构建才会快,质量高。开始: 动机: 一直不太明白ActiveController和ActiveView的关系,即两者的上下文关系。 对老系统的Rails 2.1.2 剖析,3.0.0改动太大了,下次再仔细研究。 从CGI 的dispatch 一路dispatch过来,到AC(ActiveController) def handle_request @controller = Routing::Routes.recognize(@request) @controller.process(@req…

2011-01-29 23:59