Permalink
Browse files

fixed query in helper

  • Loading branch information...
1 parent abf2e30 commit 27730315d5f51068522a19100f2f46dba8e23142 @jbasdf jbasdf committed Sep 14, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 app/helpers/muck_activity_helper.rb
@@ -37,7 +37,7 @@ def has_comments_css(activity)
# limited: a value passed to each activity template which can result in a smaller amount of data
# being rendered
def limited_activity_feed_for(activities_object, limited = false)
- activities = activities_object.activities.by_latest.created_by(activities_object).is_public.find(:all, :include => ['comments']).paginate(:page => @page, :per_page => @per_page)
+ activities = activities_object.activities.by_latest.created_by(activities_object).is_public.includes(:comments).paginate(:page => @page, :per_page => @per_page)
render :partial => 'activities/activity_feed', :locals => { :activities_object => activities_object, :activities => activities, :limited => limited }
end
@@ -113,15 +113,15 @@ def get_profile_activities(activities_object)
if !params[:latest_activity_id].blank?
activities_object.activities.by_latest.filter_by_template(params[:activity_filter]).after(params[:latest_activity_id]).is_public.created_by(activities_object).find(:all, :include => ['comments']).paginate(:page => @page, :per_page => @per_page)
else
- activities_object.activities.by_latest.filter_by_template(params[:activity_filter]).is_public.created_by(activities_object).find(:all, :include => ['comments']).paginate(:page => @page, :per_page => @per_page)
+ activities_object.activities.by_latest.filter_by_template(params[:activity_filter]).is_public.created_by(activities_object).includes(:comments).paginate(:page => @page, :per_page => @per_page)
end
end
def get_activities(activities_object)
if !params[:latest_activity_id].blank?
- activities_object.activities.by_latest.filter_by_template(params[:activity_filter]).after(params[:latest_activity_id]).find(:all, :include => ['comments']).paginate(:page => @page, :per_page => @per_page)
+ activities_object.activities.by_latest.filter_by_template(params[:activity_filter]).after(params[:latest_activity_id]).includes(:comments).paginate(:page => @page, :per_page => @per_page)
else
- activities_object.activities.by_latest.filter_by_template(params[:activity_filter]).find(:all, :include => ['comments']).paginate(:page => @page, :per_page => @per_page)
+ activities_object.activities.by_latest.filter_by_template(params[:activity_filter]).includes(:comments).paginate(:page => @page, :per_page => @per_page)
end
end

0 comments on commit 2773031

Please sign in to comment.