Module: Mobility::Plugins::Sequel::Query::QueryBuilder

Defined in:
lib/mobility/plugins/sequel/query.rb

Constant Summary collapse

IDENTITY =
->(x) { x }.freeze

Class Method Summary collapse

Class Method Details

.build(dataset, query_method, query_conds, &block) ⇒ Object


97
98
99
100
101
102
103
104
# File 'lib/mobility/plugins/sequel/query.rb', line 97

def build(dataset, query_method, query_conds, &block)
  return yield unless Hash === query_conds.first

  cond = query_conds.first.dup
  locale = cond.delete(:locale) || Mobility.locale

  _build(dataset, cond, locale, query_method, &block)
end