Skip to content

Commit

Permalink
Merge pull request #385 from AllPurposeName/patch-1
Browse files Browse the repository at this point in the history
Capitalize on potential Star Wars reference
  • Loading branch information
thiagopradi committed Oct 14, 2016
2 parents 1bc1605 + f78cce2 commit a039828
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.mkdn
Expand Up @@ -62,14 +62,14 @@ First, you need to create a config file, shards.yml, inside your config/ directo
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 => "Thiago").limit(3).using(:slave_one)
User.where(:name => "Boba").limit(3).using(:slave_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.

```ruby
Octopus.using(:slave_two) do
User.create(:name => "Mike")
User.create(:name => "Thiago")
end
```

Expand Down

0 comments on commit a039828

Please sign in to comment.