Module: Thredded::ArelCompat

Defined in:
lib/thredded/arel_compat.rb

Class Method Summary collapse

Class Method Details

.integer_division(engine, a, b) ⇒ Arel::Nodes::Node



11
12
13
14
15
16
17
# File 'lib/thredded/arel_compat.rb', line 11

def integer_division(engine, a, b)
  if engine.connection.adapter_name =~ /mysql|mariadb/i
    Arel::Nodes::InfixOperation.new('DIV', a, b)
  else
    Arel::Nodes::Division.new(a, b)
  end
end