Permalink
Browse files

adding back override of the columns

  • Loading branch information...
1 parent 61eb857 commit c1486bdd97dc7cda30b9437e65ea6290e1cd6b35 erik committed Jul 26, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/models/news_item.rb
@@ -211,7 +211,7 @@ def self.get_stories(page, topic_id, grouping_id, topic, selected_filter, curren
having_cache ["news_items_stories_", page, topic_id, grouping_id, topic, selected_filter, current_network, limit, @@per_page], {:expires_in => CACHE_TIMEOUT } do
unless limit
if selected_filter=='almost-funded'
- self.constrain_topic_id(topic_id).constrain_grouping_id(grouping_id).constrain_type(selected_filter).constrain_topic(topic).send(selected_filter.gsub('-','_')).order_results(selected_filter).browsable.by_network(current_network).paginate(:page => page)
+ self.constrain_topic_id(topic_id).constrain_grouping_id(grouping_id).constrain_type(selected_filter).constrain_topic(topic).send(selected_filter.gsub('-','_')).order_results(selected_filter).browsable.by_network(current_network).paginate(:page => page, :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" )
else
self.constrain_topic_id(topic_id).constrain_grouping_id(grouping_id).constrain_type(selected_filter).constrain_topic(topic).send(selected_filter.gsub('-','_')).order_results(selected_filter).browsable.by_network(current_network).paginate(:page => page)
end

0 comments on commit c1486bd

Please sign in to comment.