Skip to content

Commit b31bc6e

Browse files
authored
DEV: add guardian argument to TopicsFilter (#237)
As it's been added in discourse/discourse#31908
1 parent c10bd4d commit b31bc6e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.discourse-compatibility

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
< 3.5.0.beta2-dev: 7f9a0bb2a75217731de3a0168302b66453152c09
12
< 3.5.0.beta1-dev: 0390f3611ea3b635877b349e9fb38aac01e19837
23
< 3.4.0.beta2-dev: 6d52b8cfa8b3e2920aa3f12fc52673b88f53f776
34
< 3.4.0.beta1-dev: 4ebcd1187b59290b79db8c61c89df9f72bf1363c

plugin.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,8 @@ module ::DiscourseTopicVoting
119119
add_to_serializer(:current_user, :votes_count) { object.vote_count }
120120
add_to_serializer(:current_user, :votes_left) { [object.vote_limit - object.vote_count, 0].max }
121121

122-
filter_order_votes = ->(scope, order_direction) do
123-
scope = scope.joins(:topic_vote_count)
124-
scope.order(
122+
filter_order_votes = ->(scope, order_direction, _guardian) do
123+
scope.joins(:topic_vote_count).order(
125124
"COALESCE(topic_voting_topic_vote_count.votes_count, 0)::integer #{order_direction}",
126125
)
127126
end

0 commit comments

Comments
 (0)