Module Sequel::Plugins::Sharding::ClassMethods
In: lib/sequel/plugins/sharding.rb

Methods

Public Instance methods

Create a new object on the given shard s.

[Source]

    # File lib/sequel/plugins/sharding.rb, line 25
25:         def create_using_server(s, values={}, &block)
26:           new_using_server(s, values, &block).save
27:         end

Eager load the association with the given eager loader options.

[Source]

    # File lib/sequel/plugins/sharding.rb, line 30
30:         def eager_load_results(opts, eo, &block)
31:           if (s = eo[:self]) && (server = s.opts[:server])
32:             eb = eo[:eager_block]
33:             set_server = proc do |ds|
34:               ds = eb.call(ds) if eb
35:               ds = ds.server?(server)
36:               ds
37:             end
38:             eo = Hash[eo]
39:             eo[:eager_block] = set_server
40:             eo
41:           end
42: 
43:           super
44:         end

Return a newly instantiated object that is tied to the given shard s. When the object is saved, a record will be inserted on shard s.

[Source]

    # File lib/sequel/plugins/sharding.rb, line 49
49:         def new_using_server(s, values={}, &block)
50:           new(values, &block).set_server(s)
51:         end

[Validate]