Method: Sequel::Model::Associations::DatasetMethods#to_hash_groups

Defined in:
lib/sequel/model/associations.rb

#to_hash_groups(key_column, value_column = nil, opts = OPTS) ⇒ Object

If the dataset is being eagerly loaded, default to calling all instead of each.



3354
3355
3356
3357
3358
3359
3360
# File 'lib/sequel/model/associations.rb', line 3354

def to_hash_groups(key_column, value_column=nil, opts=OPTS)
  if (@opts[:eager_graph] || @opts[:eager]) && !opts.has_key?(:all)
    opts = Hash[opts]
    opts[:all] = true
  end
  super
end