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



7
8
9
# File 'lib/simple_record/sharding.rb', line 7

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

Instance Method Details

#sharded_domainObject



120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/simple_record/sharding.rb', line 120

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