摘要: touch是Rails2.3.3引入的新功能,可以将指定的attributes改为当前时间,默认是更改updated_at或updated_on。典型的用法在many-to-one时,当many端发生改变时,更新one端的updated_at时间。比如在一个论坛系统中,一个帖子的更新时间会随着之后的回复发生改变:1.classPost < ActiveRecord::Base2.has_ma... 阅读全文
posted @ 2010-08-05 18:25 麦飞 阅读(461) 评论(0) 推荐(0) 编辑
摘要: 1. Write Console Methods在~/.irbrc定义ActvieRecord::Base.connection.select_all方法1.# ~/.railsrc2.defsql(query)3.ActiveRecord::Base.connection.select_all(query)4.end1.# ~/.irbrc2.ifENV['RAILS_ENV']3.loadFi... 阅读全文
posted @ 2010-08-05 18:11 麦飞 阅读(224) 评论(1) 推荐(0) 编辑
摘要: /home/opengoss/workspace/kkk/monit-web/vendor/plugins/upload_progress/init.rb:8:in `evaluate_init_rb': undefined method `pp' for #<Rails::Plugin:0x96028dc> (NoMethodError) from /opt/ree/lib/ruby... 阅读全文
posted @ 2010-08-05 16:52 麦飞 阅读(393) 评论(0) 推荐(0) 编辑
摘要: >> pp Dir.glob(File.join(Rails.configuration.plugin_paths.first,'*'))["/home/opengoss/workspace/kkk/monit-web/vendor/plugins/upload_progress","/home/opengoss/workspace/kkk/monit-web/vendor/plugi... 阅读全文
posted @ 2010-08-05 15:53 麦飞 阅读(459) 评论(0) 推荐(0) 编辑