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

It's even uglier, but it's ...

92da0010f0175533c7cbe3474d95bcfc Talk
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...

92da0010f0175533c7cbe3474d95bcfc Talk
def create
  @partner = Partner.new(params[:partner])
  if(params[:partner_request_id])
...

Ruby Fat controller method

by Teflon Ted, March 10, 2008 00:40, No refactoring, tagged with rails fat controller

I came across this monster ...

92da0010f0175533c7cbe3474d95bcfc Talk

Ruby On Merging two sets of conditions

by Teflon Ted, October 18, 2007 12:51

Mac and Barry, I just wante...

92da0010f0175533c7cbe3474d95bcfc Talk