Class: ActiveRecord::ShardFor::HashModuloRouter
- Inherits:
-
ConnectionRouter
- Object
- ConnectionRouter
- ActiveRecord::ShardFor::HashModuloRouter
- Defined in:
- lib/activerecord/shard_for/hash_modulo_router.rb
Instance Attribute Summary
Attributes inherited from ConnectionRouter
Instance Method Summary collapse
Methods inherited from ConnectionRouter
#fetch_connection_name, #initialize
Constructor Details
This class inherits a constructor from ActiveRecord::ShardFor::ConnectionRouter
Instance Method Details
#route(key) ⇒ Object
7 8 9 |
# File 'lib/activerecord/shard_for/hash_modulo_router.rb', line 7 def route(key) hash(key) % connection_count end |