Create a new object on the given shard s.
# 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
When eagerly loading, if the current dataset has a defined shard and the dataset that you will be using to get the associated records does not, use the current dataset’s shard for the associated dataset.
# File lib/sequel/plugins/sharding.rb, line 30 30: def eager_loading_dataset(opts, ds, select, associations, eager_options={}) 31: ds = super(opts, ds, select, associations, eager_options) 32: if !ds.opts[:server] and s = eager_options[:self] and server = s.opts[:server] 33: ds = ds.server(server) 34: end 35: ds 36: 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.
# File lib/sequel/plugins/sharding.rb, line 41 41: def new_using_server(s, values={}, &block) 42: new(values, &block).set_server(s) 43: end
Set the server for each graphed dataset to the current server unless the graphed dataset already has a server set.
# File lib/sequel/plugins/sharding.rb, line 49 49: def eager_graph_dataset(opts, eager_options) 50: ds = super 51: if s = eager_options[:self].opts[:server] 52: ds = ds.server(s) unless ds.opts[:server] 53: end 54: ds 55: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.