Skip to content

Instantly share code, notes, and snippets.

@gworley3
Created March 28, 2014 21:53
Show Gist options
  • Select an option

  • Save gworley3/9843765 to your computer and use it in GitHub Desktop.

Select an option

Save gworley3/9843765 to your computer and use it in GitHub Desktop.
DbCharmer - Getting Started - sample_slave_use.rb
DbCharmer.force_slave_reads do
# all read operations againt ActiveRecord objects will now
# go against the read slaves. this extends to calls on
# ActiveRecord objects in nested function calls.
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment