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 24
24:         def create_using_server(s, values={}, &block)
25:           new_using_server(s, values, &block).save
26:         end

Eager load the association with the given eager loader options.

[Source]

    # File lib/sequel/plugins/sharding.rb, line 29
29:         def eager_load_results(opts, eo, &block)
30:           if (s = eo[:self]) && (server = s.opts[:server])
31:             eb = eo[:eager_block]
32:             set_server = proc do |ds|
33:               ds = eb.call(ds) if eb
34:               ds = ds.server?(server)
35:               ds
36:             end
37:             eo = Hash[eo]
38:             eo[:eager_block] = set_server
39:             eo
40:           end
41: 
42:           super
43:         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 48
48:         def new_using_server(s, values={}, &block)
49:           new(values, &block).set_server(s)
50:         end

[Validate]