lib/thredded/arel_compat.rb in thredded-1.0.0 vs lib/thredded/arel_compat.rb in thredded-1.0.1

- old
+ new

@@ -7,10 +7,10 @@ # @param [#connection] engine # @param [Arel::Nodes::Node] a integer node # @param [Arel::Nodes::Node] b integer node # @return [Arel::Nodes::Node] a / b def integer_division(engine, a, b) - if engine.connection.adapter_name =~ /mysql|mariadb/i + if /mysql|mariadb/i.match?(engine.connection.adapter_name) Arel::Nodes::InfixOperation.new('DIV', a, b) else Arel::Nodes::Division.new(a, b) end end