From 7e0c2b37f4eb195dadcdc24c62967e864a2fbbfb Mon Sep 17 00:00:00 2001 From: Robert Barrow Date: Sat, 12 Oct 2019 18:55:01 +0100 Subject: [PATCH] update to fix search for flag dropdown --- lib/flags.rb | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/flags.rb b/lib/flags.rb index 175aaa84..00f29866 100644 --- a/lib/flags.rb +++ b/lib/flags.rb @@ -1,8 +1,7 @@ class CustomWizard::Flag - def initialize(id, name, value) - @id = id - @name = name - @value = value + def initialize(id, name) + @id = id + @name = name end def id @@ -12,10 +11,6 @@ class CustomWizard::Flag def name @name end - - def value - @value - end end class CustomWizard::Flags @@ -25,8 +20,10 @@ class CustomWizard::Flags flagscollection = [] - raw_flags.map do |name, code| - flagscollection << CustomWizard::Flag.new(name, name, code) + raw_flags.map do |name, pic| + # This is super hacky. Adding the trailing space actually stops search breaking in the dropdown! (and doesn't compromise the view!) + # Feeding just name, name will break search + flagscollection << CustomWizard::Flag.new(name, "#{name} ") end flagscollection