This website works better with JavaScript.
Home
Explore
Help
Sign In
jyt94
/
closedSocialMastodon
forked from
closed-social/mastodon
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Projects
0
Releases
0
Wiki
Activity
Browse Source
Optimize follower_accounts and following_accounts (
#2820
)
closed-social-v3
alpaca-tc
7 years ago
committed by
Eugen Rochko
parent
3f5b994ff0
commit
ddc34feb58
5 changed files
with
5 additions
and
5 deletions
Split View
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
View File
@ -4,6 +4,6 @@ class FollowerAccountsController < ApplicationController
include
AccountControllerConcern
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
+ 1
- 1
app/controllers/following_accounts_controller.rb
View File
@ -4,6 +4,6 @@ class FollowingAccountsController < ApplicationController
include
AccountControllerConcern
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
+ 1
- 1
app/views/accounts/_follow_grid.html.haml
View File
@ -4,4 +4,4 @@
- else
= 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
View File
@ -6,4 +6,4 @@
= 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
View File
@ -6,4 +6,4 @@
= 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…
Cancel
Save