Class/Module Index [+]

Quicksearch

Sequel::Plugins::Sharding::ClassMethods

Public Instance Methods

create_using_server(s, values={}, &block) click to toggle source

Create a new object on the given shard s.

# File lib/sequel/plugins/sharding.rb, line 23
def create_using_server(s, values={}, &block)
  new_using_server(s, values, &block).save
end
eager_load_results(opts, eo, &block) click to toggle source

Eager load the association with the given eager loader options.

# File lib/sequel/plugins/sharding.rb, line 28
def eager_load_results(opts, eo, &block)
  if (s = eo[:self]) && (server = s.opts[:server])
    eb = eo[:eager_block]
    set_server = proc do |ds|
      ds = eb.call(ds) if eb
      ds = ds.server(server) unless ds.opts[:server]
      ds
    end
    eo = eo.merge(:eager_block=>set_server)
  end

  super
end
new_using_server(s, values={}, &block) click to toggle source

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 45
def new_using_server(s, values={}, &block)
  new(values, &block).set_server(s)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.