Method: Nitro::Pager#to_sql
- Defined in:
- lib/nitro/helper/pager.rb
#to_sql ⇒ Object
Create an appropriate SQL limit clause. Returns postgres/mysql compatible limit.
173 174 175 176 177 178 179 180 |
# File 'lib/nitro/helper/pager.rb', line 173 def to_sql if @start_idx > 0 return "LIMIT #{@per_page} OFFSET #{@start_idx}" else # gmosx: perhaps this is optimized ? naaaaaah... return "LIMIT #{@per_page}" end end |