Use Arel matches method in CustomEmoji search (#28615)
				
					
				
			This commit is contained in:
		
							parent
							
								
									cc67943df2
								
							
						
					
					
						commit
						e827c4692c
					
				@ -86,7 +86,7 @@ class CustomEmoji < ApplicationRecord
 | 
				
			|||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def search(shortcode)
 | 
					    def search(shortcode)
 | 
				
			||||||
      where('"custom_emojis"."shortcode" ILIKE ?', "%#{shortcode}%")
 | 
					      where(arel_table[:shortcode].matches("%#{sanitize_sql_like(shortcode)}%"))
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user