Fix legislation process feed order

We need to add an ORDER BY clause; not doing so was causing different
processes to show up sometimes. As mentioned in the PostgreSQL manual:

> Because the order of the rows in the database table is unpredictable,
> when you use the LIMIT clause, you should always use the ORDER BY
> clause to control the order of rows. If you don’t do so, you will get
> an unpredictable result set.
This commit is contained in:
Javi Martín
2019-03-21 17:12:03 +01:00
parent 1fb110259e
commit 58816aef5f

View File

@@ -31,7 +31,7 @@ class Widget::Feed < ActiveRecord::Base
end
def processes
Legislation::Process.open.published.limit(limit)
Legislation::Process.open.published.order("created_at DESC").limit(limit)
end
end