عندما أقوم باستدعاء latest.json?page=0&per_page=10&foo=bar
# TypeError:
# String can't be coerced into Integer
# ./lib/topic_query.rb:729:in `*`
https://github.dev/discourse/discourse/blob/0832cad803bb429a49595eab822a7c77dfa2088b/lib/topic_query.rb#L732-L737
أعتقد أنه يمكن حلها عن طريق:
if options[:page]
offset = options[:page].to_i * options[:per_page].to_i
result = result.offset(offset) if offset > 0
end