mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 03:03:37 +08:00
12a00d6dc5
Similar to `advanced_filter` I introduced `advanced_order`. I needed a new option because default orders are evaluated after advanced_filter so I couldn't use it. Also, that part is a little bit more generic ``` elsif word =~ /order:\w+/ @order = word.gsub('order:', '').to_sym nil ``` After those changes, I can use them in plugins in this way: ``` Search.advanced_order(:votes) do |posts| posts.reorder("COALESCE((SELECT dvvc.counter FROM discourse_voting_vote_counters dvvc WHERE dvvc.topic_id = subquery.topic_id), 0) DESC") end ``` |
||
---|---|---|
.. | ||
filter_manager.rb | ||
filter.rb | ||
instance.rb | ||
metadata.rb |