Hey,

This is sort of complicated, and I'm trying to keep it as simple as I
can.

I'm using will_paginate to display only 25 snapshots on each page.  My
question is how can I return only the most recent snapshot per link
(just one per link)?

@snapshots = Snapshot.paginate :order => 'snapshots.weighted_score
desc', :conditions => ["snapshots.scenario_id = ? and (links.status = 1
or links.status = 2 or links.status = 4)", @scenario.id], :include =>
[:page, :link, {:snapshot_attributes => :attribute}], :page =>
params[:page], :per_page => 25

Let me know if any other information is needed, and thanks for any
advice.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to