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



123
124
125
126
127
128
129
130
# File 'lib/mobility/plugins/sequel/query.rb', line 123

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