This website works better with JavaScript.
首頁
探索
說明
登入
abunchtell
/
mastodon
關註
1
收藏
0
複製
0
程式碼
問題管理
0
Activity
瀏覽代碼
Optimize follower_accounts and following_accounts (
#2820
)
master
alpaca-tc
7 年之前
committed by
Eugen Rochko
父節點
3f5b994ff0
當前提交
ddc34feb58
共有
5 個文件被更改
,包括
5 次插入
和
5 次删除
統一視圖
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-1
app/controllers/follower_accounts_controller.rb
+1
-1
app/controllers/following_accounts_controller.rb
+1
-1
app/views/accounts/_follow_grid.html.haml
+1
-1
app/views/follower_accounts/index.html.haml
+1
-1
app/views/following_accounts/index.html.haml
+ 1
- 1
app/controllers/follower_accounts_controller.rb
查看文件
@@ -4,6 +4,6 @@ class FollowerAccountsController < ApplicationController
include AccountControllerConcern
include AccountControllerConcern
def index
def index
@
accounts = @account.followers.page(params[:page]).per(FOLLOW_PER_PAGE
)
@
follows = Follow.where(target_account: @account).order(id: :desc).page(params[:page]).per(FOLLOW_PER_PAGE).preload(:account
)
end
end
end
end
+ 1
- 1
app/controllers/following_accounts_controller.rb
查看文件
@@ -4,6 +4,6 @@ class FollowingAccountsController < ApplicationController
include AccountControllerConcern
include AccountControllerConcern
def index
def index
@
accounts = @account.following.page(params[:page]).per(FOLLOW_PER_PAGE
)
@
follows = Follow.where(account: @account).order(id: :desc).page(params[:page]).per(FOLLOW_PER_PAGE).preload(:target_account
)
end
end
end
end
+ 1
- 1
app/views/accounts/_follow_grid.html.haml
查看文件
@@ -4,4 +4,4 @@
- else
- else
= render partial: 'accounts/grid_card', collection: accounts, as: :account, cached: true
= render partial: 'accounts/grid_card', collection: accounts, as: :account, cached: true
= paginate
account
s
= paginate
follow
s
+ 1
- 1
app/views/follower_accounts/index.html.haml
查看文件
@@ -6,4 +6,4 @@
= render 'accounts/header', account: @account
= render 'accounts/header', account: @account
= render 'accounts/follow_grid',
accounts: @accounts
= render 'accounts/follow_grid',
follows: @follows, accounts: @follows.map(&:account)
+ 1
- 1
app/views/following_accounts/index.html.haml
查看文件
@@ -6,4 +6,4 @@
= render 'accounts/header', account: @account
= render 'accounts/header', account: @account
= render 'accounts/follow_grid',
accounts: @accounts
= render 'accounts/follow_grid',
follows: @follows, accounts: @follows.map(&:target_account)
Write
Preview
Loading…
取消
儲存