今天要寫一個 cron script 要用到資料庫,因為已經被 Active Record 慣壞了,懶得用 SQL。所以就花點時間 Survey 怎麼再 Rails 之外使用 Active Record。簡單版1. require 相關的 lib require "rubygems" require_gem "activerecord"2. 建立 DB Connection ActiveRecord::Base.establish_connection( :adapter => "mysql", :username => "root", :host => "loc ...
突然看到了這篇文章,差點沒興奮的大叫出來!!!I have done some extensive work on active record to allow for databases to be defined in terms of "connection pools" rather than simply one database. Most of the work was completed in connection_specification.rb and is done at this level to be compatible with any backend you ...
thegiive
搜索本博客
最近加入圈子
存档
最新评论