Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

changing to if from case...

  • Loading branch information...
commit 46482da15ebf9a3a1a469c1eeb19bbe38ac0ad82 1 parent 699ec45
erik authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  app/models/news_item.rb
View
2  app/models/news_item.rb
@@ -147,7 +147,7 @@ class NewsItem < ActiveRecord::Base
}
named_scope :order_results, lambda { |type|
- return { :select => "news_items.*, case when news_items.status = 'active' then (1.0 - (news_items.current_funding / news_items.requested_amount)) else news_items.created_at end as sort_value" } if type=='almost-funded'
+ return { :select => "news_items.*, if(news_items.status='active'), 1.0 - (news_items.current_funding / news_items.requested_amount), news_items.created_at) as sort_value" } if type=='almost-funded'
return { :order=>"news_items.created_at desc" }
}
Please sign in to comment.
Something went wrong with that request. Please try again.