Displaying 1 result from an estimated 1 matches for "establish_c".
2006 May 15
8
Databases... write master, multiple read-only slaves.. will this work?
...write to one database and read from
another. From what I''ve read, Rails doesn''t do this out of the box. I
came up with something that does work, but I''m wondering if there is
something I''m missing in the code below that''s going to bite me, such as
establish_connection creating a huge number of objects as time
progresses. Or is there a better way to flip the connection back and
forth?
The below does work though. Writes do go to :writemaster and reads go to
:readslave...
Comments?
class MyModel < ActiveRecord::Base
#.....
def before_sav...