Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap using in a back ticks to indicate code. #557

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.mkdn
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ First, you need to create a config file, shards.yml, inside your config/ directo

### Syntax

Octopus adds a method to each AR Class and object: the using method is used to select the shard like this:
Octopus adds a method to each AR Class and object: the `using` method is used to select the shard like this:

```ruby
User.where(:name => "Boba").limit(3).using(:read_replica_one)
```

Octopus also supports queries within a block. When you pass a block to the using method, all queries inside the block will be sent to the specified shard.
Octopus also supports queries within a block. When you pass a block to the `using` method, all queries inside the block will be sent to the specified shard.

```ruby
Octopus.using(:read_replica_two) do
Expand Down Expand Up @@ -110,7 +110,7 @@ Each model instance knows which shard it came from so this will work automatical

### Migrations

In migrations, you also have access to the using method. The syntax is basically the same. This migration will run in the brazil and canada shards.
In migrations, you also have access to the `using` method. The syntax is basically the same. This migration will run in the brazil and canada shards.

```ruby
class CreateUsersOnBothShards < ActiveRecord::Migration
Expand Down