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

Eager load the association with the given eager loader options.

[Source]

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

[Validate]