From f1345a7ecd7dc7a2a9b37e5329ad69b56bddce07 Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 3 Mar 2020 23:00:28 -0600 Subject: [PATCH] Fix #4309: Cannot use random=false in /posts search. --- app/logical/post_sets/post.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/logical/post_sets/post.rb b/app/logical/post_sets/post.rb index 918a1c5e4..c19fda4f5 100644 --- a/app/logical/post_sets/post.rb +++ b/app/logical/post_sets/post.rb @@ -3,13 +3,13 @@ module PostSets MAX_PER_PAGE = 200 attr_reader :tag_array, :page, :raw, :random, :post_count, :format - def initialize(tags, page = 1, per_page = nil, options = {}) + def initialize(tags, page = 1, per_page = nil, raw: false, random: false, format: "html") @tag_array = Tag.scan_query(tags) @page = page @per_page = per_page - @raw = options[:raw].present? - @random = options[:random].present? - @format = options[:format] || "html" + @raw = raw.to_s.truthy? + @random = random.to_s.truthy? + @format = format.to_s end def tag_string