Module: SimpleRecord::Sharding

Included in:
Base
Defined in:
lib/simple_record/sharding.rb

Defined Under Namespace

Modules: ClassMethods, Hashing Classes: ShardedResults

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
# File 'lib/simple_record/sharding.rb', line 5

def self.included(base)
#            base.extend ClassMethods
end

Instance Method Details

#sharded_domainObject



92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/simple_record/sharding.rb', line 92

def sharded_domain
#            puts 'getting sharded_domain'
  options        = self.class.sharding_options
#            val = self.send(options[:on])
#            puts "val=" + val.inspect
#            shards = options[:shards] # is user passed in static array of shards
#            if options[:shards].is_a?(Symbol)
#                shards = self.send(shards)
#            end
  sharded_domain = "#{domain}_#{self.send(options[:map])}"
#            puts "sharded_domain=" + sharded_domain.inspect
  sharded_domain
end