Hello,
all I want to do, is to fetch the lastest item from my models and have them in an array sorted (freshest items first) by the attribute "updated_at".
Somewhere is an error, but I can't find it:
@results = Array.new
Note.find(:all, :limit => 3, :order => "created_at DESC").each do |item|
@results << item
end
Picture.find(:all, :limit => 3, :order => "created_at DESC").each do |item|
@results << item
end
@results = @results.sort_by{ |result| result.updated_at}