Method: Sequel::Model::Associations::AssociationReflection#apply_eager_limit_strategy

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

#apply_eager_limit_strategy(ds, strategy = eager_limit_strategy, limit_and_offset = limit_and_offset()) ⇒ Object

Apply an eager limit strategy to the dataset, or return the dataset unmodified if it doesn’t need an eager limit strategy.



126
127
128
129
130
131
132
133
134
135
# File 'lib/sequel/model/associations.rb', line 126

def apply_eager_limit_strategy(ds, strategy=eager_limit_strategy, limit_and_offset=limit_and_offset())
  case strategy
  when :distinct_on
    apply_distinct_on_eager_limit_strategy(ds)
  when :window_function
    apply_window_function_eager_limit_strategy(ds, limit_and_offset)
  else
    ds
  end
end