Module: Thredded::ArelCompat
- Defined in:
- lib/thredded/arel_compat.rb
Class Method Summary collapse
Instance Method Summary collapse
- #new_arel_select_manager(table) ⇒ Arel::SelectManager
- #relation_to_arel(relation) ⇒ Arel::Nodes::Node
- #true_value(engine) ⇒ Object
Class Method Details
.integer_division(engine, a, b) ⇒ Arel::Nodes::Node
Returns a / b.
15 16 17 18 19 20 21 |
# File 'lib/thredded/arel_compat.rb', line 15 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 |
Instance Method Details
#new_arel_select_manager(table) ⇒ Arel::SelectManager
38 39 40 |
# File 'lib/thredded/arel_compat.rb', line 38 def new_arel_select_manager(table) Arel::SelectManager.new(table) end |
#relation_to_arel(relation) ⇒ Arel::Nodes::Node
26 27 28 |
# File 'lib/thredded/arel_compat.rb', line 26 def relation_to_arel(relation) relation.arel end |
#true_value(engine) ⇒ Object
48 49 50 |
# File 'lib/thredded/arel_compat.rb', line 48 def true_value(_engine) true end |