method
add_limit_offset!
v3.1.0 -
Show latest stable
-
0 notes -
Class: ActiveRecord::ConnectionAdapters::DatabaseStatements
- 1.0.0 (0)
- 1.1.6 (0)
- 1.2.6 (0)
- 2.0.3 (0)
- 2.1.0 (0)
- 2.2.1 (16)
- 2.3.8 (0)
- 3.0.0 (-2)
- 3.0.9 (-2)
- 3.1.0 (4)
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0
- 7.1.3.2
- 7.1.3.4
- What's this?
add_limit_offset!(sql, options)
public
Appends LIMIT and OFFSET options to an SQL statement, or some SQL fragment that has the same semantics as LIMIT and OFFSET.
options must be a Hash which contains a :limit option and an :offset option.
This method modifies the sql parameter.
This method is deprecated!! Stop using it!
Examples
add_limit_offset!('SELECT * FROM suppliers', {:limit => 10, :offset => 50})
generates
SELECT * FROM suppliers LIMIT 10 OFFSET 50