named_scope :latest, :conditions => 'id in (select id from rank_histories rh where created_at = (select max(created_at) from rank_histories nested where nested.url = rh.url))'
Ruby On Nested select; is there a b...
by Teflon Ted,
December 11, 2008 20:32
RankHistory.find_by_sql('select * from rank_histories rh where created_at = (select max(created_at) from rank_histories nstd where nstd.url = rh.url)')
Ruby Nested select; is there a b...
by Teflon Ted,
December 11, 2008 19:26,
4 refactorings, tagged with ruby activerecord named_scope nested select sql
What I'm doing is getting t...
def create @partner = Partner.new(params[:partner]) if(params[:partner_request_id]) ...
Ruby Fat controller method
I came across this monster ...
Ruby On Merging two sets of conditions
by Teflon Ted,
October 18, 2007 12:51
Mac and Barry, I just wante...
It's even uglier, but it's ...