blah
Ruby
code posted
created at 19 Jun 01:06
Edit
|
Back
1 2 3 4 5 6 |
def children(limit = nil) found = articles.find(:all, :limit => limit, :order => 'updated_at desc') found += pages.find(:all, :limit => limit, :order => 'updated_at desc') found.sort! { |x, y| y.updated_at <=> x.updated_at } limit ? found[0, limit] : found end |
286 Bytes in 2 ms with coderay