Doozy of a pagination problem


#1

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.