12 Feb
Rails plugin mysql_replication_adapter for Rails 2.2+
Just a quick post to make available to the internet that I’ve updated the mysql_replication_adapter gem/plugin to be compatible with Rails 2.2+.
The original mysql_replication_adapter was first made available by RapLeaf. It was a gem that was released in mid-2007 and hosted on rubyforge. However, development stalled and when Rails when to version 2, the gem was no longer compatible. Fortunately, in mid-2008 rubyforge user “ckiernan” patched the gem and converted it into plugin, making it compatible with Rails 2. The patch was never committed to the main repository, so the plugin was solely available on this rubyforge tracker page.
However, the plugin again became useless with the release of Rails 2.2. The call to “require_mysql” was bombing as that method was apparently removed in Rails 2.2. And so I fixed that and put it on github for all of the Rails world to enjoy. “Git” it here:
http://github.com/findchris/mysql_replication_adapter/tree/master
Hope someone benefits from this.

Posted by Bryan Duxbury on 12.02.09 at 7:20 pm
Hey, thanks for stepping up and working on this. Do you know if your changes are compatible with Rails 1.x? If so, I’ll probably merge them in.
Posted by chris on 12.02.09 at 7:20 pm
According to the patch on the rubyforge tracker page:
>>
To use it with rails 1,
you need to add the following ABOVE the initializer block in config/environment.rb:
$:.unshift File.join(File.dirname(__FILE__), ‘../vendor/plugins/mysql_replication_adapter/lib’)
require ‘mysql_replication_adapter’
>>
So, with the caveat of adding the above lines, it should work with Rails 1.x.
-Chris
Posted by Brian on 12.02.09 at 7:20 pm
Does this work on Rails 2.3.2 or 2.3.3?
Thanks,
Brian
Posted by chris on 12.02.09 at 7:20 pm
@Brian I have not tested it on those Rails versions; let me know if it works for you.