mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:31:10 +08:00
DEV: Enable unless
cops
We discussed the use of `unless` internally and decided to enforce available rules from rubocop to restrict its most problematic uses.
This commit is contained in:

committed by
Loïc Guitaut

parent
87de3c2319
commit
f7c57fbc19
@ -430,7 +430,7 @@ class TopicQuery
|
||||
(pinned_topics + unpinned_topics)[0...limit] if limit
|
||||
else
|
||||
offset = (page * per_page) - pinned_topics.length
|
||||
offset = 0 unless offset > 0
|
||||
offset = 0 if offset <= 0
|
||||
unpinned_topics.offset(offset).to_a
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user