Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gab-social
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
gab
social
gab-social
Commits
6f8a1c01
Commit
6f8a1c01
authored
Nov 09, 2020
by
mgabdev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue in PopularLinksController with top links
• Fixed: - issue in PopularLinksController with top links
parent
68e27c07
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
app/controllers/api/v1/popular_links_controller.rb
app/controllers/api/v1/popular_links_controller.rb
+2
-2
No files found.
app/controllers/api/v1/popular_links_controller.rb
View file @
6f8a1c01
...
@@ -34,7 +34,7 @@ class Api::V1::PopularLinksController < Api::BaseController
...
@@ -34,7 +34,7 @@ class Api::V1::PopularLinksController < Api::BaseController
statusIds
=
Status
.
where
(
'statuses.created_at > ?'
,
24
.
hours
.
ago
)
statusIds
=
Status
.
where
(
'statuses.created_at > ?'
,
24
.
hours
.
ago
)
.
joins
(
:status_stat
)
.
joins
(
:status_stat
)
.
order
(
'status_stats.favourites_count DESC'
)
.
order
(
'status_stats.favourites_count DESC'
)
.
where
(
'status_stats.favourites_count > 1'
)
.
where
(
'status_stats.favourites_count > 1
5
'
)
.
joins
(
"LEFT JOIN preview_cards_statuses ON statuses.id = preview_cards_statuses.status_id"
)
.
joins
(
"LEFT JOIN preview_cards_statuses ON statuses.id = preview_cards_statuses.status_id"
)
.
where
(
'preview_cards_statuses.status_id IS NOT NULL'
)
.
where
(
'preview_cards_statuses.status_id IS NOT NULL'
)
.
limit
(
100
)
.
limit
(
100
)
...
@@ -43,7 +43,7 @@ class Api::V1::PopularLinksController < Api::BaseController
...
@@ -43,7 +43,7 @@ class Api::V1::PopularLinksController < Api::BaseController
cards
=
PreviewCard
.
joins
(
"LEFT JOIN preview_cards_statuses ON preview_cards.id = preview_cards_statuses.preview_card_id"
)
cards
=
PreviewCard
.
joins
(
"LEFT JOIN preview_cards_statuses ON preview_cards.id = preview_cards_statuses.preview_card_id"
)
.
where
(
'preview_cards_statuses.preview_card_id IS NOT NULL'
)
.
where
(
'preview_cards_statuses.preview_card_id IS NOT NULL'
)
.
where
(
'preview_cards_statuses.status_id IN (?)'
,
statusIds
)
.
where
(
'preview_cards_statuses.status_id IN (?)'
,
statusIds
)
.
having
(
'COUNT(preview_cards_statuses.preview_card_id) >
1
'
)
.
having
(
'COUNT(preview_cards_statuses.preview_card_id) >
2
'
)
.
where
(
'preview_cards.updated_at > ?'
,
24
.
hours
.
ago
)
.
where
(
'preview_cards.updated_at > ?'
,
24
.
hours
.
ago
)
.
order
(
'COUNT(preview_cards_statuses.preview_card_id) DESC'
)
.
order
(
'COUNT(preview_cards_statuses.preview_card_id) DESC'
)
.
group
(
'preview_cards.id'
)
.
group
(
'preview_cards.id'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment