From aab9f57e369c492bad03bcf15411394897314b4d Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 12 Mar 2016 16:09:46 +0100 Subject: Adding config for puma, dashboard layout, fixing some queries --- app/controllers/accounts_controller.rb | 2 +- app/controllers/api/accounts_controller.rb | 2 +- app/controllers/home_controller.rb | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 156926927..47d114416 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -5,7 +5,7 @@ class AccountsController < ApplicationController before_action :set_webfinger_header def show - @statuses = @account.statuses.order('id desc').includes(thread: [:account], reblog: [:account], stream_entry: []) + @statuses = @account.statuses.order('id desc').with_includes.with_counters respond_to do |format| format.html diff --git a/app/controllers/api/accounts_controller.rb b/app/controllers/api/accounts_controller.rb index ac16ed7c1..13c2b3d8a 100644 --- a/app/controllers/api/accounts_controller.rb +++ b/app/controllers/api/accounts_controller.rb @@ -15,7 +15,7 @@ class Api::AccountsController < ApiController end def statuses - @statuses = @account.statuses.order('created_at desc') + @statuses = @account.statuses.with_includes.with_counts.order('created_at desc') end def follow diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 294749a22..5238b2fc0 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,8 +1,16 @@ class HomeController < ApplicationController + layout 'dashboard' + before_action :authenticate_user! def index feed = Feed.new(:home, current_user.account) @statuses = feed.get(20, (params[:offset] || 0).to_i) end + + def mentions + feed = Feed.new(:mentions, current_user.account) + @statuses = feed.get(20, (params[:offset] || 0).to_i) + render action: :index + end end -- cgit