Hey peeps ! <@492751562872193025> Just tried using...
# avo-2
l
Hey peeps ! @lemon-wall-20836 Just tried using your script (https://docs.avohq.io/2.0/upgrade.html#upgrade-from-2-12-to-2-13) to update the search queries, but it didn't work as is. I had to: - Move the
old_search_query
and
new_search_query
variables inside the method definition - Navigate to the
app/avo/resources
folder to launch the script (running it from root with the full path did not work) Maybe worth updating for future users ?
l
@loud-jewelry-99127 can you please check it out and try to reproduce it?
thank you @late-king-9468 for bringing it to our attention
l
@late-king-9468 sorry for the inconvenient, can use this one
Copy code
DONT_TOUCH = ['.', '..', $0]
OLD_SEARCH_QUERY = "self.search_query = ->(params:) do"
NEW_SEARCH_QUERY = "self.search_query = -> do"
def remove_params_keyword(file_name)
  content = File.read file_name
  content.gsub!(OLD_SEARCH_QUERY, NEW_SEARCH_QUERY)
  File.open(file_name, "w") { |file| file << content }
end
Dir.foreach(".") {|file_name| remove_params_keyword file_name unless DONT_TOUCH.include? file_name}
meanwhile we'll update the documentation as well, thanks for the report!
4 Views