Flowdock
method

add_order_by_for_association_limiting!

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

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 as a sub-select and ordering in that query.

Show source
Register or log in to add new notes.