Hatena::Groupbioruby

"aac".translate #=> "N" このページをアンテナに追加 RSSフィード

2006-10-17A simple solution for using two or more databases on Rails

app/models/term.rb

|  app/models/term.rb - "aac".translate #=> "N" を含むブックマーク はてなブックマーク -  app/models/term.rb - "aac".translate #=> "N"  app/models/term.rb - "aac".translate #=> "N" のブックマークコメント

Give up to establish database re-connection transparency (See also g:bioruby:id:nakao_mitsuteru:20061015 and g:bioruby:id:nakao_mitsuteru:20061016 ). But, at least, MySQL allow to use tables in unconected database.

db_options = {:adapter => 'mysql', 
	      :host => 'localhost', 
	      :username => 'uniprot', 
	      :database => 'uniprot_development'}
ActiveRecord::Base.establish_connection(db_options)

class Entry < ActiveRecord::Base
end

class Term < ActiveRecord::Base
  set_table_name "go.term"
end
トラックバック - http://bioruby.g.hatena.ne.jp/nakao_mitsuteru/20061017