Method: Sequel::Dataset#order_append
- Defined in:
- lib/sequel/dataset/query.rb
permalink #order_append(*columns, &block) ⇒ Object
Returns a copy of the dataset with the order columns added to the end of the existing order.
DB[:items].order(:a).order(:b) # SELECT * FROM items ORDER BY b
DB[:items].order(:a).order_append(:b) # SELECT * FROM items ORDER BY a, b
818 819 820 821 |
# File 'lib/sequel/dataset/query.rb', line 818 def order_append(*columns, &block) columns = @opts[:order] + columns if @opts[:order] order(*columns, &block) end |