首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网络技术 > 网络基础 >

Rails读写分开实现

2012-10-28 
Rails读写分离实现报表组件读写分离实现#These methods are created for db slice:ReadOnly.def self.upda

Rails读写分离实现
报表组件读写分离实现#These methods are created for db slice:ReadOnly.
def self.update_report report
ReportUpdate.find(report.id).update_attributes(report.attributes)
end

def self.create_report new_report    ReportUpdate.create(new_report.attributes)  end

end

?

?

数据库配置文件代码:

jobs:
adapter: mysql
host: *
username: *
password: *
database: *
encoding: utf8
master_db:
adapter: mysql
host: *
username: *
password: *
database: *
encoding: utf8
mysql: &using
adapter: mysql
host: *
username: *
password: *
database: *
encoding: utf8
development:
<<: *using
production:
<<: *using
test:
<<: *localhost

热点排行