Flowdock
method

add_order_by_for_association_limiting!

Importance_1
v2.3.2 - Show latest stable - 0 notes - Class: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
add_order_by_for_association_limiting!(sql, options) public

Returns an ORDER BY clause for the passed order option.

PostgreSQL does not allow arbitrary ordering when using DISTINCT ON, so we work around this by wrapping the sql string as a sub-select and ordering in that query.

Show source
Register or log in to add new notes.